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 ++++++++++++++++++++++++++-- js/panels/Timeline/Style.reel/Style.js | 8 ++------ 2 files changed, 28 insertions(+), 8 deletions(-) (limited to 'js/panels') 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(); } diff --git a/js/panels/Timeline/Style.reel/Style.js b/js/panels/Timeline/Style.reel/Style.js index ed7a281a..a0dc7c6b 100644 --- a/js/panels/Timeline/Style.reel/Style.js +++ b/js/panels/Timeline/Style.reel/Style.js @@ -376,14 +376,10 @@ var LayerStyle = exports.LayerStyle = Montage.create(Component, { this._fillColorCtrl.props = { side: 'top', align: 'center', wheel: true, palette: true, gradient: false, image: false, nocolor: true, offset: -80 }; this.application.ninja.colorController.addButton("chip", this._fillColorCtrl); this.abcelement = this._fillColorCtrl; - var currentValue = ElementsMediator.getColor(this.parentComponent.parentComponent.parentComponent.parentComponent.layerData.stageElement,true) + var currentValue = ElementsMediator.getColor(this.parentComponent.parentComponent.parentComponent.parentComponent.layerData.stageElement,this._isFill,this._borderSide) this._fillColorCtrl.addEventListener("change", this.handleFillColorChange.bind(this), false); - this.addedColorChips = true; - } - - if (this.addedColorChips) { this._fillColorCtrl.color(currentValue.colorMode, currentValue.color); - // this._strokeColorCtrl.color(this._stroke.colorMode, this._stroke.color); + this.addedColorChips = true; } // TODO: set up color chip here. -- cgit v1.2.3