Changeset - ee3273dc1589
[Not reviewed]
default
0 1 0
Drew Perttula - 7 years ago 2018-05-19 23:35:42
drewp@bigasterisk.com
restore the code that updates zoomFlattened
Ignore-this: cc276917562be6e3a3837f5dc728855a
1 file changed with 7 insertions and 1 deletions:
0 comments (0 inline, 0 general)
light9/web/timeline/timeline.coffee
Show inline comments
 
@@ -286,24 +286,25 @@ coffeeElementSetup(class TimelineEditor 
 
# the brick layout. update only changing adjusters.
 
coffeeElementSetup(class TimeZoomed extends Polymer.mixinBehaviors([Polymer.IronResizableBehavior], Polymer.Element)
 
  @is: 'light9-timeline-time-zoomed'
 
  @getter_properties:
 
    graph: { type: Object, notify: true }
 
    project: { type: Object }
 
    selection: { type: Object, notify: true }
 
    song: { type: String, notify: true }
 
    viewState: { type: Object, notify: true }
 
    inlineAttrConfigs: { type: Array, value: [] } # only for inlineattrs that should be displayed
 
  @getter_observers: [
 
    '_onGraph(graph, setAdjuster, song, viewState, project)',
 
    'onZoom(viewState)',
 
  ]
 
  constructor: ->
 
    super()
 
    @notes = []
 
    @stage = new PIXI.Container()
 
    @stage.interactive=true
 
    
 
    @renderer = PIXI.autoDetectRenderer({
 
        backgroundColor: 0x606060,
 
        antialias: true,
 
        forceCanvas: true,
 
    })
 
@@ -325,25 +326,30 @@ coffeeElementSetup(class TimeZoomed exte
 
      
 
  _onResize: ->
 
    @$.rows.firstChild.style.position = 'relative'
 
    @$.rows.firstChild.style.top = -@viewState.rowsY() + 'px'
 

	
 
    @renderer.resize(@clientWidth, @clientHeight + @viewState.rowsY())
 
    
 
    @renderer.render(@stage)
 
  
 
  _onGraph: (graph, setAdjuster, song, viewState, project)->
 
    return unless @song # polymer will call again
 
    @graph.runHandler(@gatherNotes.bind(@), 'zoom notes')
 
    
 
  onZoom: ->
 
    updateZoomFlattened = ->
 
      log('updateZoomFlattened')
 
      @zoomFlattened = ko.toJS(@viewState.zoomSpec)
 
    ko.computed(updateZoomFlattened.bind(@))
 

	
 
  gatherNotes: ->
 
    U = (x) => @graph.Uri(x)
 
    return unless @song?
 

	
 
    songNotes = @graph.objects(U(@song), U(':note'))
 
    
 
    @stage.removeChildren()
 
    n.destroy() for n in @notes
 
    @notes = []
 
    
 
    noteNum = 0
 
    for uri in _.sortBy(songNotes, 'id')
0 comments (0 inline, 0 general)