Changeset - dd868395ccd1
[Not reviewed]
default
0 1 0
drewp@bigasterisk.com - 8 years ago 2017-06-11 22:16:15
drewp@bigasterisk.com
guard against corrupt drops into timeline. i was getting some ':effectClass <>' in logs
Ignore-this: 70b460992912a6922140cc2b577423d1
1 file changed with 2 insertions and 0 deletions:
0 comments (0 inline, 0 general)
light9/web/timeline/timeline.coffee
Show inline comments
 
@@ -294,24 +294,26 @@ Polymer
 
    updateZoomFlattened = ->
 
      log('updateZoomFlattened')
 
      @zoomFlattened = ko.toJS(@zoom)
 
    ko.computed(updateZoomFlattened.bind(@))
 
  ready: ->
 

	
 
  attached: ->
 
    root = @closest('light9-timeline-editor')
 

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

	
 
    return unless effect and effect.match(/^http/)
 

	
 
    # we could probably accept some initial overrides right on the
 
    # effect uri, maybe as query params
 

	
 
    if not @graph.contains(effect, RDF + 'type', U(':Effect'))
 
      if @graph.contains(effect, RDF + 'type', U(':LightSample'))
 
        effect = @makeEffect(effect)
 
      else
 
        log("drop #{effect} is not an effect")
 
        return
 

	
 
    dropTime = @zoomInX.invert(pos.e(1))
 
    @makeNewNote(effect, dropTime)
0 comments (0 inline, 0 general)