diff options
Diffstat (limited to 'js/panels/Timeline/Keyframe.reel')
-rw-r--r-- | js/panels/Timeline/Keyframe.reel/Keyframe.js | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/js/panels/Timeline/Keyframe.reel/Keyframe.js b/js/panels/Timeline/Keyframe.reel/Keyframe.js index b91027b6..c8255cc0 100644 --- a/js/panels/Timeline/Keyframe.reel/Keyframe.js +++ b/js/panels/Timeline/Keyframe.reel/Keyframe.js | |||
@@ -28,6 +28,21 @@ var Keyframe = exports.Keyframe = Montage.create(Component, { | |||
28 | } | 28 | } |
29 | }, | 29 | }, |
30 | 30 | ||
31 | _isSelected:{ | ||
32 | value:false | ||
33 | }, | ||
34 | |||
35 | isSelected:{ | ||
36 | serializable:true, | ||
37 | get:function(){ | ||
38 | return this._isSelected; | ||
39 | }, | ||
40 | set:function(value){ | ||
41 | this._isSelected = value; | ||
42 | this.needsDraw = true; | ||
43 | } | ||
44 | }, | ||
45 | |||
31 | prepareForDraw:{ | 46 | prepareForDraw:{ |
32 | value:function(){ | 47 | value:function(){ |
33 | this.element.addEventListener("click", this, false); | 48 | this.element.addEventListener("click", this, false); |
@@ -42,20 +57,29 @@ var Keyframe = exports.Keyframe = Montage.create(Component, { | |||
42 | 57 | ||
43 | draw:{ | 58 | draw:{ |
44 | value:function(){ | 59 | value:function(){ |
60 | if(this.isSelected){ | ||
61 | this.element.classList.add("keyframeSelected"); | ||
62 | this.application.ninja.timeline.selectedStyle = this.parentComponent.parentComponent.parentComponent.trackEditorProperty; | ||
63 | }else{ | ||
64 | this.element.classList.remove("keyframeSelected"); | ||
65 | this.application.ninja.timeline.selectedStyle = !(this.parentComponent.parentComponent.parentComponent.trackEditorProperty); | ||
66 | } | ||
45 | this.element.style.left = (this.position - 5) + "px"; | 67 | this.element.style.left = (this.position - 5) + "px"; |
46 | } | 68 | } |
47 | }, | 69 | }, |
48 | 70 | ||
49 | deselectKeyframe:{ | 71 | deselectKeyframe:{ |
50 | value:function(){ | 72 | value:function(){ |
51 | this.element.classList.remove("keyframeSelected"); | 73 | debugger; |
74 | this.isSelected=false; | ||
52 | this.element.style.left = (this.position - 5) + "px"; | 75 | this.element.style.left = (this.position - 5) + "px"; |
53 | } | 76 | } |
54 | }, | 77 | }, |
55 | 78 | ||
56 | selectKeyframe:{ | 79 | selectKeyframe:{ |
57 | value:function(){ | 80 | value:function(){ |
58 | this.element.classList.add("keyframeSelected"); | 81 | debugger; |
82 | this.isSelected=true; | ||
59 | this.element.style.left = (this.position - 6) + "px"; | 83 | this.element.style.left = (this.position - 6) + "px"; |
60 | this.parentComponent.selectTween(); | 84 | this.parentComponent.selectTween(); |
61 | } | 85 | } |