Changeset - 2aeceb6f03aa
[Not reviewed]
default
0 2 0
drewp@bigasterisk.com - 20 months ago 2023-06-02 16:42:48
drewp@bigasterisk.com
edit-choice defaults to no 'rename' button
2 files changed with 4 insertions and 3 deletions:
0 comments (0 inline, 0 general)
light9/live/Light9DeviceSettings.ts
Show inline comments
 
@@ -40,25 +40,25 @@ export class Light9DeviceSettings extend
 
    `,
 
  ];
 

	
 
  render() {
 
    return html`
 
      <rdfdb-synced-graph></rdfdb-synced-graph>
 

	
 
      <h1>effect DeviceSettings</h1>
 

	
 
      <div id="save">
 
        <div>
 
          <button @click=${this.newEffect}>New effect</button>
 
          <edit-choice .uri=${this.currentEffect ? this.currentEffect.uri : null} @edited=${this.onEffectChoice2}></edit-choice>
 
          <edit-choice .uri=${this.currentEffect ? this.currentEffect.uri : null} @edited=${this.onEffectChoice2} rename></edit-choice>
 
          <button @click=${this.clearAll}>clear settings in this effect</button>
 
        </div>
 
      </div>
 

	
 
      <div id="deviceControls">
 
        ${this.devices.map(
 
          (device: NamedNode) => html`
 
            <light9-device-control .uri=${device} .effect=${this.currentEffect}> .graphToControls={this.graphToControls} </light9-device-control>
 
          `
 
        )}
 
      </div>
 
    `;
light9/web/EditChoice.ts
Show inline comments
 
@@ -54,50 +54,51 @@ function setupDrop(
 
    }
 
    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;
 
  @property({ type: Boolean }) rename = false;
 
  static styles = [
 
    css`
 
      :host {
 
        display: inline-block;
 
        background: #141448;
 
        min-width: 10em;
 
        /* 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>
 
      <resource-display .uri=${this.uri} ?rename=${this.rename}></resource-display>
 
      ${this.nounlink ? html`` : unlink}
 
    `;
 
  }
 

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

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