aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKruti Shah2012-06-08 11:27:40 -0700
committerKruti Shah2012-06-08 11:27:40 -0700
commitc1cd060be878d30fda71140dc850b8d1ac68c6ad (patch)
treedf9d9a74cc5de5393a3d8c946217b6f119896357
parent8986b9f78174b10790ad00e5a28122cb0879e5e3 (diff)
downloadninja-c1cd060be878d30fda71140dc850b8d1ac68c6ad.tar.gz
Color chip in TP
Signed-off-by: Kruti Shah <kruti.shah@motorola.com>
-rwxr-xr-xjs/controllers/elements/element-controller.js2
-rw-r--r--js/panels/Timeline/Keyframe.reel/Keyframe.js28
-rw-r--r--js/panels/Timeline/Style.reel/Style.js8
3 files changed, 29 insertions, 9 deletions
diff --git a/js/controllers/elements/element-controller.js b/js/controllers/elements/element-controller.js
index db1d5e49..f37a9249 100755
--- a/js/controllers/elements/element-controller.js
+++ b/js/controllers/elements/element-controller.js
@@ -108,7 +108,7 @@ exports.ElementController = Montage.create(Component, {
108 } else { 108 } else {
109 // Try getting border color from specific side first 109 // Try getting border color from specific side first
110 if(borderSide) { 110 if(borderSide) {
111 color = this.getProperty(el, "border-" + borderSide + "-color"); 111 color = this.getProperty(el, "border-" + borderSide + "-color",true);
112 image = this.getProperty(el, "border-" + borderSide + "-image"); 112 image = this.getProperty(el, "border-" + borderSide + "-image");
113 } 113 }
114 114
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 }
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, {
376 this._fillColorCtrl.props = { side: 'top', align: 'center', wheel: true, palette: true, gradient: false, image: false, nocolor: true, offset: -80 }; 376 this._fillColorCtrl.props = { side: 'top', align: 'center', wheel: true, palette: true, gradient: false, image: false, nocolor: true, offset: -80 };
377 this.application.ninja.colorController.addButton("chip", this._fillColorCtrl); 377 this.application.ninja.colorController.addButton("chip", this._fillColorCtrl);
378 this.abcelement = this._fillColorCtrl; 378 this.abcelement = this._fillColorCtrl;
379 var currentValue = ElementsMediator.getColor(this.parentComponent.parentComponent.parentComponent.parentComponent.layerData.stageElement,true) 379 var currentValue = ElementsMediator.getColor(this.parentComponent.parentComponent.parentComponent.parentComponent.layerData.stageElement,this._isFill,this._borderSide)
380 this._fillColorCtrl.addEventListener("change", this.handleFillColorChange.bind(this), false); 380 this._fillColorCtrl.addEventListener("change", this.handleFillColorChange.bind(this), false);
381 this.addedColorChips = true;
382 }
383
384 if (this.addedColorChips) {
385 this._fillColorCtrl.color(currentValue.colorMode, currentValue.color); 381 this._fillColorCtrl.color(currentValue.colorMode, currentValue.color);
386 // this._strokeColorCtrl.color(this._stroke.colorMode, this._stroke.color); 382 this.addedColorChips = true;
387 } 383 }
388 384
389 // TODO: set up color chip here. 385 // TODO: set up color chip here.