diff options
author | Jon Reid | 2012-05-01 17:46:09 -0700 |
---|---|---|
committer | Jon Reid | 2012-05-01 17:46:09 -0700 |
commit | 73c4f7f449ba58e70f7335ef932b23dd450c925b (patch) | |
tree | acfb5d8004c2c11c994d6ee81f48c9f4a0109949 /js/panels/Timeline/Keyframe.reel/Keyframe.js | |
parent | 8c1fda5e59b9d88b69e0b4a2bd57590ef451643c (diff) | |
download | ninja-73c4f7f449ba58e70f7335ef932b23dd450c925b.tar.gz |
Timeline: Initial keyframe drag-and-drop interaction.
Diffstat (limited to 'js/panels/Timeline/Keyframe.reel/Keyframe.js')
-rw-r--r-- | js/panels/Timeline/Keyframe.reel/Keyframe.js | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/js/panels/Timeline/Keyframe.reel/Keyframe.js b/js/panels/Timeline/Keyframe.reel/Keyframe.js index 859cdfb1..df5bdd67 100644 --- a/js/panels/Timeline/Keyframe.reel/Keyframe.js +++ b/js/panels/Timeline/Keyframe.reel/Keyframe.js | |||
@@ -31,6 +31,16 @@ var Keyframe = exports.Keyframe = Montage.create(Component, { | |||
31 | prepareForDraw:{ | 31 | prepareForDraw:{ |
32 | value:function(){ | 32 | value:function(){ |
33 | this.element.addEventListener("click", this, false); | 33 | this.element.addEventListener("click", this, false); |
34 | |||
35 | // Drag and drop event handlers | ||
36 | this.element.addEventListener("mouseover", this.handleMouseover.bind(this), false); | ||
37 | this.element.addEventListener("mouseout", this.handleMouseout.bind(this), false); | ||
38 | this.element.addEventListener("dragstart", this.handleDragstart.bind(this), false); | ||
39 | |||
40 | |||
41 | |||
42 | |||
43 | |||
34 | } | 44 | } |
35 | }, | 45 | }, |
36 | 46 | ||
@@ -57,5 +67,23 @@ var Keyframe = exports.Keyframe = Montage.create(Component, { | |||
57 | value:function(ev){ | 67 | value:function(ev){ |
58 | this.selectKeyframe(); | 68 | this.selectKeyframe(); |
59 | } | 69 | } |
60 | } | 70 | }, |
71 | |||
72 | handleMouseover: { | ||
73 | value: function(event) { | ||
74 | this.element.draggable = true; | ||
75 | } | ||
76 | }, | ||
77 | handleMouseout: { | ||
78 | value: function(event) { | ||
79 | this.element.draggable = false; | ||
80 | } | ||
81 | }, | ||
82 | handleDragstart: { | ||
83 | value: function(event) { | ||
84 | //this.parentComponent.parentComponent.dragLayerID = this.layerID; | ||
85 | event.dataTransfer.setData('Text', 'Keyframe'); | ||
86 | } | ||
87 | }, | ||
88 | |||
61 | }); | 89 | }); |