Changeset - e3de5d1208ca
[Not reviewed]
default
0 1 0
drewp@bigasterisk.com - 9 years ago 2016-06-11 17:16:55
drewp@bigasterisk.com
refactor makeNewNote
Ignore-this: b1f934761ccb6359f9625cf4cc5969f8
1 file changed with 8 insertions and 6 deletions:
0 comments (0 inline, 0 general)
light9/web/timeline/timeline.coffee
Show inline comments
 
@@ -221,9 +221,7 @@ Polymer
 
  attached: ->
 
    root = @closest('light9-timeline-editor')
 
    setupDrop @, @$.rows, root, (effect, pos) =>
 

	
 
      U = (x) -> @graph.Uri(x)
 
      quad = (s, p, o) => {subject: s, predicate: p, object: o, graph: @song}
 

	
 
      # we could probably accept some initial overrides right on the
 
      # effect uri, maybe as query params
 
@@ -233,10 +231,15 @@ Polymer
 
        return
 
      
 
      dropTime = @zoomInX.invert(pos.e(1))
 
      @makeNewNote(effect, dropTime)
 
      
 
      newNote = graph.nextNumberedResource("#{@song}/n")
 
      newCurve = graph.nextNumberedResource("#{newNote}c")
 
      points = graph.nextNumberedResources("#{newCurve}p", 4)
 
  makeNewNote: (effect, dropTime) ->
 
    U = (x) -> @graph.Uri(x)
 
    quad = (s, p, o) => {subject: s, predicate: p, object: o, graph: @song}
 
      
 
    newNote = @graph.nextNumberedResource("#{@song}/n")
 
    newCurve = @graph.nextNumberedResource("#{newNote}c")
 
    points = @graph.nextNumberedResources("#{newCurve}p", 4)
 
      
 
      curveQuads = [
 
          quad(@song, U(':note'), newNote)
 
@@ -260,7 +263,6 @@ Polymer
 
        }
 
      @graph.applyAndSendPatch(patch)
 
      
 

	
 
Polymer
 
  is: "light9-timeline-time-axis",
 
  # for now since it's just one line calling dia,
0 comments (0 inline, 0 general)