Permalink
Browse files

Implement renameInstruction.

  • Loading branch information...
whitequark committed Mar 20, 2013
1 parent 4a7fa97 commit d33d18166a41c7831b3264c15b8640a8b1fbc481
Showing with 9 additions and 5 deletions.
  1. +9 −5 lib/furnace-xray/app/assets/javascripts/lib/input.js.coffee
@@ -14,14 +14,14 @@ class @Input
transforms = Object.extended()
@source.events.each (x, i) =>
- switch x.event
+ switch x.event
when 'addInstruction'
reducer.add x.name
@events.add i
when 'removeInstruction'
reducer.exclude x.name
@events.add i
- when 'updateInstruction'
+ when 'updateInstruction', 'renameInstruction'
@events.add i if reducer.any(x.name)
when 'type', 'transformStart'
else
@@ -32,7 +32,7 @@ class @Input
transforms[id] = {id: id, label: x.name}
@transforms = transforms.values()
- @transforms = @transforms.filter (x, i) =>
+ @transforms = @transforms.filter (x, i) =>
x.length = (@transforms[i+1]?.id || @events.length) - x.id
x.id < @events.length-1
@@ -60,7 +60,7 @@ class @Input
else
@previousState = new InputState(@)
- @reset()
+ @reset()
@increment(to)
increment: (to) ->
@@ -131,4 +131,8 @@ class @Input
@instructionsMap.locate event.name, (i) =>
@instructions[i].unlink()
- transformStart: (event) ->
+ renameInstruction: (event) ->
+ @instructionsMap.locate event.name, (i) =>
+ @instructions[i].name = event.new_name
+
+ transformStart: (event) ->

0 comments on commit d33d181

Please sign in to comment.