Changeset - 96e0e013e28d
[Not reviewed]
default
0 1 0
Drew Perttula - 8 years ago 2017-06-09 08:25:19
drewp@bigasterisk.com
delete key deletes selected notes
Ignore-this: dea1199f74a3ac37a150b11a306b8c1f
1 file changed with 11 insertions and 4 deletions:
0 comments (0 inline, 0 general)
light9/web/timeline/timeline.coffee
Show inline comments
 
@@ -101,12 +101,16 @@ Polymer
 
    @bindKeys()
 
    @bindWheelZoom(@dia.querySelector('svg'))
 
    @forwardMouseEventsToAdjustersCanvas()
 

	
 
    @makeZoomAdjs()
 

	
 
    zoomed = @$.zoomed
 
    setupDrop(@$.dia.querySelector('svg'), zoomed.$.rows, @, zoomed.onDrop.bind(zoomed))
 

	
 

	
 
  zoomOrLayoutChanged: ->
 
    # not for cursor updates
 

	
 
    window.debug_zoomOrLayoutChangedCount++
 
    @fullZoomX.domain([0, @viewState.zoomSpec.duration()])
 
    @fullZoomX.range([0, @width()])
 
@@ -277,13 +281,12 @@ Polymer
 
      @zoomFlattened = ko.toJS(@zoom)
 
    ko.computed(updateZoomFlattened.bind(@))
 
  ready: ->
 

	
 
  attached: ->
 
    root = @closest('light9-timeline-editor')
 
    setupDrop(@, @$.rows, root, @onDrop.bind(@))
 

	
 
  onDrop: (effect, pos) ->
 
    U = (x) => @graph.Uri(x)
 

	
 
    # we could probably accept some initial overrides right on the
 
    # effect uri, maybe as query params
 
@@ -634,15 +637,19 @@ Polymer
 
      @colorScaleFromGraph = '#ffffff'
 
      @colorScale = '#ffffff'
 
    console.timeEnd('attrs update')
 

	
 

	
 
  onDel: ->
 
    patch = {delQuads: [{subject: @song, predicate: @graph.Uri(':note'), object: @uri, graph: @song}], addQuads: []}
 
    @graph.applyAndSendPatch(patch)
 
    deleteNote(@graph, @song, @uri)
 

	
 

	
 
deleteNote = (graph, song, note) ->
 
  patch = {delQuads: [{subject: song, predicate: graph.Uri(':note'), object: note, graph: song}], addQuads: []}
 
  graph.applyAndSendPatch(patch)
 
  
 

	
 
Polymer
 
  is: 'light9-cursor-canvas'
 
  behaviors: [ Polymer.IronResizableBehavior ]
 
  listeners: 'iron-resize': 'update'
 

	
 
@@ -870,13 +877,13 @@ Polymer
 
    selection: {type: Object, notify: true}
 
  }
 
  ready: ->
 
    @elemById = {}
 

	
 
  attached: ->
 
    @querySelector('svg').add
 
    
 

	
 
  setTimeAxis: (width, yTop, scale) ->
 
    pxPerTick = 50
 
    axis = d3.axisTop(scale).ticks(width / pxPerTick)
 
    d3.select(@$.timeAxis).attr('transform', 'translate(0,'+yTop+')').call(axis)
 

	
0 comments (0 inline, 0 general)