diff options
Diffstat (limited to 'js/panels/Timeline/Keyframe.reel')
-rw-r--r-- | js/panels/Timeline/Keyframe.reel/Keyframe.js | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/js/panels/Timeline/Keyframe.reel/Keyframe.js b/js/panels/Timeline/Keyframe.reel/Keyframe.js index 859cdfb1..f7259d29 100644 --- a/js/panels/Timeline/Keyframe.reel/Keyframe.js +++ b/js/panels/Timeline/Keyframe.reel/Keyframe.js | |||
@@ -31,6 +31,17 @@ 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 | this.element.addEventListener("dragend", this.handleDragend.bind(this), false); | ||
40 | |||
41 | |||
42 | |||
43 | |||
44 | |||
34 | } | 45 | } |
35 | }, | 46 | }, |
36 | 47 | ||
@@ -57,5 +68,29 @@ var Keyframe = exports.Keyframe = Montage.create(Component, { | |||
57 | value:function(ev){ | 68 | value:function(ev){ |
58 | this.selectKeyframe(); | 69 | this.selectKeyframe(); |
59 | } | 70 | } |
60 | } | 71 | }, |
72 | |||
73 | handleMouseover: { | ||
74 | value: function(event) { | ||
75 | this.element.draggable = true; | ||
76 | } | ||
77 | }, | ||
78 | handleMouseout: { | ||
79 | value: function(event) { | ||
80 | this.element.draggable = false; | ||
81 | } | ||
82 | }, | ||
83 | handleDragstart: { | ||
84 | value: function(event) { | ||
85 | //this.parentComponent.parentComponent.dragLayerID = this.layerID; | ||
86 | event.dataTransfer.setData('Text', 'Keyframe'); | ||
87 | this.parentComponent.parentComponent.parentComponent.draggingIndex = this.parentComponent.tweenID; | ||
88 | } | ||
89 | }, | ||
90 | handleDragend: { | ||
91 | value: function(event) { | ||
92 | this.parentComponent.isDragging = false; | ||
93 | } | ||
94 | } | ||
95 | |||
61 | }); | 96 | }); |