Changeset - e9caffe926df
[Not reviewed]
default
0 1 0
drewp@bigasterisk.com - 20 months ago 2023-06-02 01:30:25
drewp@bigasterisk.com
attribute 'nounlink' to save space
1 file changed with 5 insertions and 1 deletions:
0 comments (0 inline, 0 general)
light9/web/EditChoice.ts
Show inline comments
 
@@ -53,48 +53,52 @@ function setupDrop(
 
      log(e);
 
    }
 
    unhighlight();
 
  });
 
}
 

	
 
// Picks a URI based on the caller setting the property OR
 
// the user drag-and-dropping a text/uri-list resource (probably
 
// an <resource-display> or <a href> tag)
 
@customElement("edit-choice")
 
export class EditChoice extends LitElement {
 
  @property() uri?: NamedNode
 
  @property({ type: Boolean }) nounlink = false;
 
  static styles = [
 
    css`
 
      :host {
 
        display: inline-block;
 
        background: #141448;
 
        min-width: 10em;
 
        padding: 3px 8px;
 
      }
 
      .dragging {
 
        background: rgba(126, 52, 245, 0.0784313725490196);
 
        box-shadow: 0 0 20px #ffff00;
 
      }
 
      a {
 
        color: #8e8eff;
 
        padding: 3px;
 
        display: inline-block;
 
        font-size: 145%;
 
      }
 
    `,
 
  ];
 
  render() {
 
    const unlink = html`
 
    <button @click=${this.unlink}>Unlink</button>
 
    `
 
    return html`
 
      <resource-display .uri=${this.uri} rename></resource-display>
 
      <button @click=${this.unlink}>Unlink</button>
 
      ${this.nounlink ? html`` : unlink}
 
    `;
 
  }
 

	
 
  constructor() {
 
    super();
 
    setupDrop(this, this, null, this._setUri.bind(this));
 
  }
 

	
 
  // updated(changedProperties: PropertyValues) {
 
  //   log('cp' ,changedProperties)
 
  //   if (changedProperties.has("box")) {
 
  //     log('setupdrop', this.box)
0 comments (0 inline, 0 general)