aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Timeline/Layer.reel
diff options
context:
space:
mode:
authorKruti Shah2012-02-08 10:50:46 -0800
committerKruti Shah2012-02-08 10:50:46 -0800
commit8e8dadde520de60e5d556d7ca9bdecf7c98381fe (patch)
tree350db2035ae35f8ea20ce94f2e251eb7131f3437 /js/panels/Timeline/Layer.reel
parent6787bda807ad3974b29cab77628cc5c3c1b06a9d (diff)
parenta460855c2132bffc666582659520e575d687d0cd (diff)
downloadninja-8e8dadde520de60e5d556d7ca9bdecf7c98381fe.tar.gz
Merge branch 'refs/heads/Timeline' into Timeline_updated
Diffstat (limited to 'js/panels/Timeline/Layer.reel')
-rw-r--r--js/panels/Timeline/Layer.reel/Layer.html5
-rw-r--r--js/panels/Timeline/Layer.reel/Layer.js29
2 files changed, 31 insertions, 3 deletions
diff --git a/js/panels/Timeline/Layer.reel/Layer.html b/js/panels/Timeline/Layer.reel/Layer.html
index add6cb38..add28385 100644
--- a/js/panels/Timeline/Layer.reel/Layer.html
+++ b/js/panels/Timeline/Layer.reel/Layer.html
@@ -66,6 +66,11 @@
66 "boundObjectPropertyPath" : "objectAtCurrentIteration.editorProperty", 66 "boundObjectPropertyPath" : "objectAtCurrentIteration.editorProperty",
67 "oneway" : false 67 "oneway" : false
68 }, 68 },
69 "isSelected" : {
70 "boundObject" : {"@": "repetition1"},
71 "boundObjectPropertyPath" : "objectAtCurrentIteration.isSelected",
72 "oneway" : false
73 },
69 "editorValue" : { 74 "editorValue" : {
70 "boundObject" : {"@": "repetition1"}, 75 "boundObject" : {"@": "repetition1"},
71 "boundObjectPropertyPath" : "objectAtCurrentIteration.editorValue", 76 "boundObjectPropertyPath" : "objectAtCurrentIteration.editorValue",
diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js
index 29171272..c5f5d7e4 100644
--- a/js/panels/Timeline/Layer.reel/Layer.js
+++ b/js/panels/Timeline/Layer.reel/Layer.js
@@ -103,6 +103,7 @@ var Layer = exports.Layer = Montage.create(Component, {
103 _isSelected:{ 103 _isSelected:{
104 value: false, 104 value: false,
105 writable: true, 105 writable: true,
106 serializable: true,
106 enumerable: false 107 enumerable: false
107 }, 108 },
108 109
@@ -111,7 +112,22 @@ var Layer = exports.Layer = Montage.create(Component, {
111 return this._isSelected; 112 return this._isSelected;
112 }, 113 },
113 set:function(value){ 114 set:function(value){
114 this._isSelected = value; 115 if (value !== this._isSelected) {
116 // Only concerned about different values
117 if (value === false) {
118 // Deselect all of the styles
119 var i = 0, arrLayerStylesLength = this.arrLayerStyles.length;
120 if (arrLayerStylesLength > 0) {
121 for (i = 0; i < arrLayerStylesLength; i++) {
122 this.arrLayerStyles[i].isSelected = false;
123 }
124 this.styleRepetition.selectedIndexes = null;
125 }
126 }
127 this._isSelected = value;
128 this.needsDraw = true;
129 }
130
115 } 131 }
116 }, 132 },
117 _isAnimated:{ 133 _isAnimated:{
@@ -335,6 +351,12 @@ var Layer = exports.Layer = Montage.create(Component, {
335 this.styleCollapser.bypassAnimation = true; 351 this.styleCollapser.bypassAnimation = true;
336 this.styleCollapser.toggle(); 352 this.styleCollapser.toggle();
337 } 353 }
354
355 if (this.isSelected) {
356 this.element.classList.add("selected");
357 } else {
358 this.element.classList.remove("selected");
359 }
338 } 360 }
339 }, 361 },
340 /* End: Draw cycle */ 362 /* End: Draw cycle */
@@ -398,6 +420,7 @@ var Layer = exports.Layer = Montage.create(Component, {
398 newStyle.editorProperty = ""; 420 newStyle.editorProperty = "";
399 newStyle.editorValue = ""; 421 newStyle.editorValue = "";
400 newStyle.ruleTweener = false; 422 newStyle.ruleTweener = false;
423 newStyle.isSelected = true;
401 424
402 if (!!this.styleRepetition.selectedIndexes) { 425 if (!!this.styleRepetition.selectedIndexes) {
403 mySelection = this.styleRepetition.selectedIndexes[0]; 426 mySelection = this.styleRepetition.selectedIndexes[0];
@@ -450,13 +473,13 @@ var Layer = exports.Layer = Montage.create(Component, {
450 handleAddStyleClick: { 473 handleAddStyleClick: {
451 value: function(event) { 474 value: function(event) {
452 // Stop the event propagation 475 // Stop the event propagation
453 event.stopPropagation(); 476 //event.stopPropagation();
454 this.addStyle(); 477 this.addStyle();
455 } 478 }
456 }, 479 },
457 handleDeleteStyleClick: { 480 handleDeleteStyleClick: {
458 value: function(event) { 481 value: function(event) {
459 event.stopPropagation(); 482 //event.stopPropagation();
460 this.deleteStyle(); 483 this.deleteStyle();
461 } 484 }
462 }, 485 },