changeset 1661:d8ccc0df69de

edit-choice use resource display, unlink button Ignore-this: a0bd52abc48cb9861416ab39ca923331
author drewp@bigasterisk.com
date Sat, 10 Jun 2017 23:38:20 +0000
parents 71ee518b18bf
children 4272e727438e
files light9/web/edit-choice.coffee light9/web/edit-choice.html light9/web/resource-display.html
diffstat 3 files changed, 14 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/light9/web/edit-choice.coffee	Sat Jun 10 23:36:09 2017 +0000
+++ b/light9/web/edit-choice.coffee	Sat Jun 10 23:38:20 2017 +0000
@@ -51,6 +51,7 @@
       ]
 
     ready: ->
+      @uri = null
       setupDrop @$.box, @$.box, null, (uri) =>
         @uri=uri
         @updateLabel()
@@ -64,3 +65,6 @@
         catch
           @uri
 
+    unlink: ->
+      @uri = null
+
--- a/light9/web/edit-choice.html	Sat Jun 10 23:36:09 2017 +0000
+++ b/light9/web/edit-choice.html	Sat Jun 10 23:38:20 2017 +0000
@@ -1,4 +1,5 @@
 <link rel="import" href="/lib/polymer/polymer.html">
+<link rel="import" href="resource-display.html">
 
 <!-- see light9/editchoice.py for gtk version -->
 <dom-module id="edit-choice">
@@ -7,9 +8,11 @@
      #box {
          display: inline-block;
          background: #141448;
+         min-width: 10em;
      }
      #box.dragging {
          background: rgba(126, 52, 245, 0.0784313725490196);
+         box-shadow: 0 0 20px #ffff00;
      }
      a {
          color: #8e8eff;
@@ -18,12 +21,11 @@
          font-size: 145%;
      }
      
-     
     </style>
     <div id="box">
-      <!-- maybe use resource-display for this part -->
-      <a href="{{uri}}" title="{{label}}"><!-- type icon goes here -->{{label}}</a>
-      <!-- <button on-click="unlink">Unlink</button>  -->
+      Effect:
+      <resource-display graph="{{graph}}" uri="{{uri}}" rename></resource-display>
+      <button on-click="unlink">Unlink</button>
     </div>
   </template>
   <script src="edit-choice.js"></script>
--- a/light9/web/resource-display.html	Sat Jun 10 23:36:09 2017 +0000
+++ b/light9/web/resource-display.html	Sat Jun 10 23:38:20 2017 +0000
@@ -14,7 +14,10 @@
          zpadding: 2px;
      }
     </style>
-    <span class$="[[resClasses]]"><a href="{{uri}}">{{label}}</a></span>
+    <span class$="[[resClasses]]"><a href="{{uri}}">
+      <!-- type icon goes here -->
+      {{label}}
+    </a></span>
     <template is="dom-if" if="{{rename}}">
       <button on-click="onRename">Rename</button>