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