aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Timeline/Keyframe.reel/Keyframe.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels/Timeline/Keyframe.reel/Keyframe.js')
-rw-r--r--js/panels/Timeline/Keyframe.reel/Keyframe.js29
1 files changed, 27 insertions, 2 deletions
diff --git a/js/panels/Timeline/Keyframe.reel/Keyframe.js b/js/panels/Timeline/Keyframe.reel/Keyframe.js
index b91027b6..f450dd8a 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,21 +57,31 @@ 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 console.log(this.application.ninja.timeline.selectedStyle)
64 }else{
65 this.element.classList.remove("keyframeSelected");
66 this.application.ninja.timeline.selectedStyle = !(this.parentComponent.parentComponent.parentComponent.trackEditorProperty);
67 }
45 this.element.style.left = (this.position - 5) + "px"; 68 this.element.style.left = (this.position - 5) + "px";
46 } 69 }
47 }, 70 },
48 71
49 deselectKeyframe:{ 72 deselectKeyframe:{
50 value:function(){ 73 value:function(){
51 this.element.classList.remove("keyframeSelected"); 74 this.isSelected=false;
52 this.element.style.left = (this.position - 5) + "px"; 75 this.element.style.left = (this.position - 5) + "px";
76 this.application.ninja.timeline.selectedStyle = !(this.parentComponent.parentComponent.parentComponent.trackEditorProperty)
53 } 77 }
54 }, 78 },
55 79
56 selectKeyframe:{ 80 selectKeyframe:{
57 value:function(){ 81 value:function(){
58 this.element.classList.add("keyframeSelected"); 82 this.isSelected=true;
59 this.element.style.left = (this.position - 6) + "px"; 83 this.element.style.left = (this.position - 6) + "px";
84 this.application.ninja.timeline.selectedStyle = this.parentComponent.parentComponent.parentComponent.trackEditorProperty
60 this.parentComponent.selectTween(); 85 this.parentComponent.selectTween();
61 } 86 }
62 }, 87 },