Changeset - 2362fcf5e220
[Not reviewed]
default
0 2 0
Drew Perttula - 8 years ago 2017-06-07 05:48:04
drewp@bigasterisk.com
paper-slider didn't clear when i wrote to immediate-value
Ignore-this: d91f72fe55ebe2cc9b3b4050a598c1ff
2 files changed with 4 insertions and 0 deletions:
0 comments (0 inline, 0 general)
light9/web/live/index.html
Show inline comments
 
@@ -120,24 +120,25 @@
 
                 background: black;
 
             }
 
         }
 
         
 
        </style>
 

	
 
        <template is="dom-if" if="{{deviceAttr.useSlider}}">
 
          <paper-slider min="0"
 
                        max="{{deviceAttr.max}}"
 
                        step=".001"
 
                        editable
 
                        content-type="application/json"
 
                        value="{{sliderWriteValue}}"
 
                        immediate-value="{{immediateSlider}}"></paper-slider>
 
        </template>
 
        <template is="dom-if" if="{{deviceAttr.useColor}}">
 
        <div id="colorControls">
 
          <button on-click="goBlack">0.0</button>
 
          <light9-color-picker color="{{value}}"></light9-color-picker>
 
         
 
        </div>
 
        </template>
 
        <template is="dom-if" if="{{deviceAttr.useChoice}}">
 
          <light9-listbox choices="{{deviceAttr.choices}}" value="{{value}}">
 
          </light9-listbox>
light9/web/live/live.coffee
Show inline comments
 
log = console.log
 

	
 
Polymer
 
  is: 'light9-live-control'
 
  properties:
 
    device: { type: String }
 
    deviceAttr: { type: Object }
 
    max: { type: Number, value: 1 }
 
    value: { type: Object, notify: true }
 
    
 
    immediateSlider: { notify: true, observer: 'onSlider' }
 
    sliderWriteValue: { type: Number }
 
    pickedChoice: { observer: 'onChange' }
 
  observers: [
 
    'onChange(value)'
 
    ]
 
  ready: ->
 
    
 
  onSlider: -> @value = @immediateSlider
 
  goBlack: -> @value = "#000000"
 
  onChange: (value) ->
 
    @lastSent = [[@device, @deviceAttr.uri, value]]
 
    @resend()
 
  resend: ->
 
    window.gather(@lastSent)
 
  clear: ->
 
    @pickedChoice = null
 
    @sliderWriteValue = 0
 
    if @deviceAttr.useColor
 
      @value = '#000000'
 
    else
 
      @value = @immediateSlider = 0
 

	
 
Polymer
 
  is: "light9-live-device-control"
 
  properties:
 
    graph: { type: Object, notify: true }
 
    uri: { type: String, notify: true }
 
    deviceClass: { type: String, notify: true }
 
    deviceAttrs: { type: Array, notify: true }
0 comments (0 inline, 0 general)