Changeset - e6eb97a87117
[Not reviewed]
default
0 1 0
Drew Perttula - 7 years ago 2018-06-05 06:06:51
drewp@bigasterisk.com
fix 'clear all' in live
Ignore-this: cae71ca982f3f136a57f6399480ffcb2
1 file changed with 8 insertions and 2 deletions:
0 comments (0 inline, 0 general)
light9/web/live/live.coffee
Show inline comments
 
@@ -79,12 +79,16 @@ coffeeElementSetup(class Light9LiveDevic
 
        daRow.max = 1
 
        if dataType.equals(U(':angle'))
 
          # varies
 
          daRow.max = 1
 

	
 
      @push('deviceAttrs', daRow)
 
  clear: ->
 
    for lc in @shadowRoot.querySelectorAll("light9-live-control")
 
      lc.clear()
 
    
 
)
 
    
 
coffeeElementSetup(class Light9LiveControls extends Polymer.Element
 
  @is: "light9-live-controls"
 
  @getter_properties:
 
    graph: { type: Object, notify: true }
 
@@ -177,18 +181,20 @@ coffeeElementSetup(class Light9LiveContr
 
    log('save', patch)
 
    @graph.applyAndSendPatch(patch)
 
    @newEffectName = ''
 

	
 
  onGraph: ->
 
    @graph.runHandler(@update.bind(@), 'controls')
 
    
 
  resendAll: ->
 
    for llc in @getElementsByTagName("light9-live-control")
 
      llc.resend()
 
      
 
  clearAll: ->
 
    for llc in @getElementsByTagName("light9-live-control")
 
      llc.clear()
 
    for dc in @shadowRoot.querySelectorAll("light9-live-device-control")
 
      dc.clear()
 
    
 
  update: ->
 
    U = (x) => @graph.Uri(x)
 

	
 
    @set('devices', [])
 
    for dc in @graph.sortedUris(@graph.subjects(U('rdf:type'), U(':DeviceClass')))
0 comments (0 inline, 0 general)