From c1cd060be878d30fda71140dc850b8d1ac68c6ad Mon Sep 17 00:00:00 2001 From: Kruti Shah Date: Fri, 8 Jun 2012 11:27:40 -0700 Subject: Color chip in TP Signed-off-by: Kruti Shah --- js/panels/Timeline/Keyframe.reel/Keyframe.js | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'js/panels/Timeline/Keyframe.reel') 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, { } }, + _isSelected:{ + value:false + }, + + isSelected:{ + serializable:true, + get:function(){ + return this._isSelected; + }, + set:function(value){ + this._isSelected = value; + this.needsDraw = true; + } + }, + prepareForDraw:{ value:function(){ this.element.addEventListener("click", this, false); @@ -42,20 +57,29 @@ var Keyframe = exports.Keyframe = Montage.create(Component, { draw:{ value:function(){ + if(this.isSelected){ + this.element.classList.add("keyframeSelected"); + this.application.ninja.timeline.selectedStyle = this.parentComponent.parentComponent.parentComponent.trackEditorProperty; + }else{ + this.element.classList.remove("keyframeSelected"); + this.application.ninja.timeline.selectedStyle = !(this.parentComponent.parentComponent.parentComponent.trackEditorProperty); + } this.element.style.left = (this.position - 5) + "px"; } }, deselectKeyframe:{ value:function(){ - this.element.classList.remove("keyframeSelected"); + debugger; + this.isSelected=false; this.element.style.left = (this.position - 5) + "px"; } }, selectKeyframe:{ value:function(){ - this.element.classList.add("keyframeSelected"); + debugger; + this.isSelected=true; this.element.style.left = (this.position - 6) + "px"; this.parentComponent.selectTween(); } -- cgit v1.2.3 From bedb38e14887b29eae3cdf1c8d435259c920257c Mon Sep 17 00:00:00 2001 From: Kruti Shah Date: Tue, 12 Jun 2012 13:05:12 -0700 Subject: Sub Props Signed-off-by: Kruti Shah --- js/panels/Timeline/Keyframe.reel/Keyframe.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'js/panels/Timeline/Keyframe.reel') diff --git a/js/panels/Timeline/Keyframe.reel/Keyframe.js b/js/panels/Timeline/Keyframe.reel/Keyframe.js index c8255cc0..f450dd8a 100644 --- a/js/panels/Timeline/Keyframe.reel/Keyframe.js +++ b/js/panels/Timeline/Keyframe.reel/Keyframe.js @@ -60,6 +60,7 @@ var Keyframe = exports.Keyframe = Montage.create(Component, { if(this.isSelected){ this.element.classList.add("keyframeSelected"); this.application.ninja.timeline.selectedStyle = this.parentComponent.parentComponent.parentComponent.trackEditorProperty; + console.log(this.application.ninja.timeline.selectedStyle) }else{ this.element.classList.remove("keyframeSelected"); this.application.ninja.timeline.selectedStyle = !(this.parentComponent.parentComponent.parentComponent.trackEditorProperty); @@ -70,17 +71,17 @@ var Keyframe = exports.Keyframe = Montage.create(Component, { deselectKeyframe:{ value:function(){ - debugger; this.isSelected=false; this.element.style.left = (this.position - 5) + "px"; + this.application.ninja.timeline.selectedStyle = !(this.parentComponent.parentComponent.parentComponent.trackEditorProperty) } }, selectKeyframe:{ value:function(){ - debugger; this.isSelected=true; this.element.style.left = (this.position - 6) + "px"; + this.application.ninja.timeline.selectedStyle = this.parentComponent.parentComponent.parentComponent.trackEditorProperty this.parentComponent.selectTween(); } }, -- cgit v1.2.3 From 7887aafbff794e9c5f918c667e73a8386c38cf02 Mon Sep 17 00:00:00 2001 From: Kruti Shah Date: Tue, 12 Jun 2012 13:18:02 -0700 Subject: Clean up Signed-off-by: Kruti Shah --- js/panels/Timeline/Keyframe.reel/Keyframe.js | 3 --- 1 file changed, 3 deletions(-) (limited to 'js/panels/Timeline/Keyframe.reel') diff --git a/js/panels/Timeline/Keyframe.reel/Keyframe.js b/js/panels/Timeline/Keyframe.reel/Keyframe.js index f450dd8a..ba6952aa 100644 --- a/js/panels/Timeline/Keyframe.reel/Keyframe.js +++ b/js/panels/Timeline/Keyframe.reel/Keyframe.js @@ -60,10 +60,8 @@ var Keyframe = exports.Keyframe = Montage.create(Component, { if(this.isSelected){ this.element.classList.add("keyframeSelected"); this.application.ninja.timeline.selectedStyle = this.parentComponent.parentComponent.parentComponent.trackEditorProperty; - console.log(this.application.ninja.timeline.selectedStyle) }else{ this.element.classList.remove("keyframeSelected"); - this.application.ninja.timeline.selectedStyle = !(this.parentComponent.parentComponent.parentComponent.trackEditorProperty); } this.element.style.left = (this.position - 5) + "px"; } @@ -73,7 +71,6 @@ var Keyframe = exports.Keyframe = Montage.create(Component, { value:function(){ this.isSelected=false; this.element.style.left = (this.position - 5) + "px"; - this.application.ninja.timeline.selectedStyle = !(this.parentComponent.parentComponent.parentComponent.trackEditorProperty) } }, -- cgit v1.2.3