aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Timeline/Layer.reel/Layer.js
diff options
context:
space:
mode:
authorJon Reid2012-02-07 18:44:06 -0800
committerJon Reid2012-02-07 18:44:06 -0800
commitad81fc7e75225d24ffaf59bb179a32aa12f5141a (patch)
tree5666374f64a16fe83b6d6d627f77d041341be51f /js/panels/Timeline/Layer.reel/Layer.js
parente247f0c9bd596f0aeba6f6239ea9bd4178f5d50d (diff)
downloadninja-ad81fc7e75225d24ffaf59bb179a32aa12f5141a.tar.gz
Timeline: select/deselect layers. Work on focus/blur for layers.
Diffstat (limited to 'js/panels/Timeline/Layer.reel/Layer.js')
-rw-r--r--js/panels/Timeline/Layer.reel/Layer.js29
1 files changed, 26 insertions, 3 deletions
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 },