diff options
author | Jon Reid | 2012-05-15 11:24:53 -0700 |
---|---|---|
committer | Jon Reid | 2012-05-15 11:24:53 -0700 |
commit | 3e02135df2ee028ae43d0e2456c04e24ecee0e86 (patch) | |
tree | d6dcab6756e3da0038a39527cfe0f9ca89e92310 /js/panels/Timeline/Keyframe.reel | |
parent | 53a604d0ccb1315576b94406cf3b0b958162307b (diff) | |
parent | e33a4e58c271a9507082694a5268b840fdd05968 (diff) | |
download | ninja-3e02135df2ee028ae43d0e2456c04e24ecee0e86.tar.gz |
Merge branch 'timeline-local' into timeline-multiselect
Conflicts:
js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
resolved using theirs. (selectLayers)
Diffstat (limited to 'js/panels/Timeline/Keyframe.reel')
-rw-r--r-- | js/panels/Timeline/Keyframe.reel/Keyframe.html | 7 | ||||
-rw-r--r-- | js/panels/Timeline/Keyframe.reel/Keyframe.js | 43 |
2 files changed, 45 insertions, 5 deletions
diff --git a/js/panels/Timeline/Keyframe.reel/Keyframe.html b/js/panels/Timeline/Keyframe.reel/Keyframe.html index 7e917b5a..4b029874 100644 --- a/js/panels/Timeline/Keyframe.reel/Keyframe.html +++ b/js/panels/Timeline/Keyframe.reel/Keyframe.html | |||
@@ -1,4 +1,4 @@ | |||
1 | <!DOCTYPE html> | 1 | <!DOCTYPE html> |
2 | <!-- <copyright> | 2 | <!-- <copyright> |
3 | This file contains proprietary software owned by Motorola Mobility, Inc.<br/> | 3 | This file contains proprietary software owned by Motorola Mobility, Inc.<br/> |
4 | No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/> | 4 | No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/> |
@@ -11,8 +11,7 @@ | |||
11 | <script type="text/montage-serialization"> | 11 | <script type="text/montage-serialization"> |
12 | { | 12 | { |
13 | "owner": { | 13 | "owner": { |
14 | "module": "js/panels/Timeline/Keyframe.reel", | 14 | "prototype": "js/panels/Timeline/Keyframe.reel", |
15 | "name": "Keyframe", | ||
16 | "properties": { | 15 | "properties": { |
17 | "element": {"#": "keyframespace"} | 16 | "element": {"#": "keyframespace"} |
18 | } | 17 | } |
@@ -23,7 +22,7 @@ | |||
23 | </head> | 22 | </head> |
24 | <body> | 23 | <body> |
25 | 24 | ||
26 | <div id="keyframespace" class="tween_keyframe"> | 25 | <div data-montage-id="keyframespace" class="tween_keyframe"> |
27 | </div> | 26 | </div> |
28 | 27 | ||
29 | </body> | 28 | </body> |
diff --git a/js/panels/Timeline/Keyframe.reel/Keyframe.js b/js/panels/Timeline/Keyframe.reel/Keyframe.js index 859cdfb1..a4f957cf 100644 --- a/js/panels/Timeline/Keyframe.reel/Keyframe.js +++ b/js/panels/Timeline/Keyframe.reel/Keyframe.js | |||
@@ -31,6 +31,12 @@ 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); | ||
34 | } | 40 | } |
35 | }, | 41 | }, |
36 | 42 | ||
@@ -56,6 +62,41 @@ var Keyframe = exports.Keyframe = Montage.create(Component, { | |||
56 | handleClick:{ | 62 | handleClick:{ |
57 | value:function(ev){ | 63 | value:function(ev){ |
58 | this.selectKeyframe(); | 64 | this.selectKeyframe(); |
65 | ev.stopPropagation(); | ||
59 | } | 66 | } |
60 | } | 67 | }, |
68 | |||
69 | handleMouseover: { | ||
70 | value: function(event) { | ||
71 | this.element.draggable = true; | ||
72 | } | ||
73 | }, | ||
74 | handleMouseout: { | ||
75 | value: function(event) { | ||
76 | this.element.draggable = false; | ||
77 | } | ||
78 | }, | ||
79 | handleDragstart: { | ||
80 | value: function(event) { | ||
81 | //this.parentComponent.parentComponent.dragLayerID = this.layerID; | ||
82 | event.dataTransfer.setData('Text', 'Keyframe'); | ||
83 | |||
84 | // Get my index in my track's tween array | ||
85 | var i = 0, | ||
86 | tweenRepetitionLength = this.parentComponent.parentComponent.parentComponent.tweenRepetition.childComponents.length, | ||
87 | myIndex = null; | ||
88 | for (i = 0; i < tweenRepetitionLength; i++) { | ||
89 | if (this.parentComponent.parentComponent.parentComponent.tweenRepetition.childComponents[i].uuid === this.parentComponent.uuid) { | ||
90 | myIndex = i; | ||
91 | } | ||
92 | } | ||
93 | this.parentComponent.parentComponent.parentComponent.draggingIndex = myIndex; | ||
94 | } | ||
95 | }, | ||
96 | handleDragend: { | ||
97 | value: function(event) { | ||
98 | this.parentComponent.isDragging = false; | ||
99 | } | ||
100 | } | ||
101 | |||
61 | }); | 102 | }); |