Changeset - 6a9f9af9d3b8
[Not reviewed]
default
0 1 0
drewp@bigasterisk.com - 3 years ago 2022-06-01 19:19:46
drewp@bigasterisk.com
EditChoice sends new choice in event
1 file changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
light9/web/EditChoice.ts
Show inline comments
 
// see light9/editchoice.py for gtk version
 
import debug from "debug";
 
import { css, html, LitElement } from "lit";
 
import { customElement, property } from "lit/decorators.js";
 
import { NamedNode } from "n3";
 

	
 
export { ResourceDisplay } from "../web/ResourceDisplay";
 
const log = debug("editchoice");
 
const RDFS = "http://www.w3.org/2000/01/rdf-schema#";
 

	
 
function setupDrop(
 
  senseElem: HTMLElement,
 
  highlightElem: HTMLElement,
 
  coordinateOriginElem: HTMLElement | null,
 
  onDrop: (uri: NamedNode, pos: Vector | null) => void
 
) {
 
  const highlight = () => highlightElem.classList.add("dragging");
 
  const unhighlight = () => highlightElem.classList.remove("dragging");
 

	
 
@@ -94,19 +94,19 @@ export class EditChoice extends LitEleme
 
  }
 

	
 
  // updated(changedProperties: PropertyValues) {
 
  //   log('cp' ,changedProperties)
 
  //   if (changedProperties.has("box")) {
 
  //     log('setupdrop', this.box)
 
  //     setupDrop(this.box, this.box, null, this._setUri.bind(this));
 
  //   }
 
  // }
 

	
 
  _setUri(u: any) {
 
    this.uri = u;
 
    this.dispatchEvent(new CustomEvent("edited"));
 
    this.dispatchEvent(new CustomEvent("edited", {detail: {newValue: u}}));
 
  }
 

	
 
  unlink() {
 
    return this._setUri(null);
 
  }
 
}
0 comments (0 inline, 0 general)