aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Timeline/Layer.reel/Layer.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels/Timeline/Layer.reel/Layer.js')
-rw-r--r--js/panels/Timeline/Layer.reel/Layer.js206
1 files changed, 81 insertions, 125 deletions
</
diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js
index b23da749..8df0e9ae 100644
--- a/js/panels/Timeline/Layer.reel/Layer.js
+++ b/js/panels/Timeline/Layer.reel/Layer.js
@@ -51,6 +51,7 @@ var Layer = exports.Layer = Montage.create(Component, {
51 value: false 51 value: false
52 }, 52 },
53 styleRepetition : { 53 styleRepetition : {
54 serializable: true,
54 get: function() { 55 get: function() {
55 return this._styleRepetition; 56 return this._styleRepetition;
56 }, 57 },
@@ -61,8 +62,17 @@ var Layer = exports.Layer = Montage.create(Component, {
61 _styleCounter : { 62 _styleCounter : {
62 value: 0 63 value: 0
63 }, 64 },
65 styleCounter:{
66 serializable:true,
67 get:function () {
68 return this._styleCounter;
69 },
70 set:function (newVal) {
71 this._styleCounter = newVal;
72 }
73 },
64 74
65 /* Layer models: the name, ID, and selected and animation booleans for the layer */ 75 /* Layer models: the name, ID, and selected and animation booleans for the layer */
66 _layerName:{ 76 _layerName:{
67 value: "Default Layer Name" 77 value: "Default Layer Name"
68 }, 78 },
@@ -73,13 +83,13 @@ var Layer = exports.Layer = Montage.create(Component, {
73 return this._layerName; 83 return this._layerName;
74 }, 84 },
75 set:function(newVal){ 85 set:function(newVal){
76
77 this._layerEditable.value = newVal; 86 this._layerEditable.value = newVal;
78 this._layerName = newVal; 87 this._layerName = newVal;
79 this.layerData.layerName = newVal; 88 this.layerData.layerName = newVal;
80 if (typeof(this.dynamicLayerName) !== "undefined") { 89 if (typeof(this.dynamicLayerName) !== "undefined") {
81 this.dynamicLayerName.value = newVal; 90 this.dynamicLayerName.value = newVal;
82 } 91 }
92
83 } 93 }
84 }, 94 },
85 _layerID:{ 95 _layerID:{
@@ -123,6 +133,20 @@ var Layer = exports.Layer = Montage.create(Component, {
123 } 133 }
124 }, 134 },
125 135
136 _stageElement: {
137 value: null
138 },
139
140 stageElement: {
141 get: function() {
142 return this._stageElement;
143 },
144 set: function(newVal) {
145 this._stageElement = newVal;
146 this.layerData.stageElement = newVal;
147 }
148 },
149
126 150
127 _elementsList : { 151 _elementsList : {
128 value: [] 152 value: []
@@ -137,7 +161,7 @@ var Layer = exports.Layer = Montage.create(Component, {
137 } 161 }
138 }, 162 },
139 163
140 /* Position and Transform hottext values */ 164 /* Position and Size hottext values */
141 _dtextPositionX : { 165 _dtextPositionX : {
142 value:null 166 value:null
143 }, 167 },
@@ -210,60 +234,6 @@ var Layer = exports.Layer = Montage.create(Component, {
210 } 234 }
211 }, 235 },
212 236
213 _dtextSkewX : {
214 value:null
215 },
216
217 dtextSkewX:{
218 serializable: true,
219 get:function(){
220 return this._dtextSkewX;
221 },
222 set:function(value){
223 if (this._dtextSkewX !== value) {
224 this._dtextSkewX = value;
225 this.layerData.dtextSkewX = value;
226 }
227
228 }
229 },
230
231 _dtextSkewY : {
232 value:null
233 },
234
235 dtextSkewY:{
236 serializable: true,
237 get:function(){
238 return this._dtextSkewY;
239 },
240 set:function(value){
241 if (this._dtextSkewY !== value) {
242 this._dtextSkewY = value;
243 this.layerData.dtextSkewY = value;
244 }
245
246 }
247 },
248
249 _dtextRotate : {
250 value:null
251 },
252
253 dtextRotate:{
254 serializable: true,
255 get:function(){
256 return this._dtextRotate;
257 },
258 set:function(value){
259 if (this._dtextRotate !== value) {
260 this._dtextRotate = value;
261 this.layerData.dtextRotate = value;
262 }
263
264 }
265 },
266
267 /* isSelected: whether or not the layer is currently selected. */ 237 /* isSelected: whether or not the layer is currently selected. */
268 _isSelected:{ 238 _isSelected:{
269 value: false 239 value: false
@@ -362,20 +332,6 @@ var Layer = exports.Layer = Montage.create(Component, {
362 } 332 }
363 }, 333 },
364 334
365 _isTransformCollapsed : {
366 value: true
367 },
368 isTransformCollapsed : {
369 serializable: true,
370 get: function() {
371 return this._isTransformCollapsed;
372 },
373 set: function(newVal) {
374 this._isTransformCollapsed = newVal;
375 this.layerData.isTransformCollapsed = newVal;
376 }
377 },
378
379 _isPositionCollapsed : { 335 _isPositionCollapsed : {
380 value: true 336 value: true
381 }, 337 },
@@ -456,10 +412,10 @@ var Layer = exports.Layer = Montage.create(Component, {
456 412
457 this.layerName = this.layerData.layerName; 413 this.layerName = this.layerData.layerName;
458 this.layerID = this.layerData.layerID; 414 this.layerID = this.layerData.layerID;
415 this.stageElement = this.layerData.stageElement
459 this.arrLayerStyles = this.layerData.arrLayerStyles; 416 this.arrLayerStyles = this.layerData.arrLayerStyles;
460 this.isMainCollapsed = this.layerData.isMainCollapsed; 417 this.isMainCollapsed = this.layerData.isMainCollapsed;
461 this.isPositionCollapsed = this.layerData.isPositionCollapsed; 418 this.isPositionCollapsed = this.layerData.isPositionCollapsed;
462 this.isTransformCollapsed = this.layerData.isTransformCollapsed;
463 this.isSelected = this.layerData.isSelected; 419 this.isSelected = this.layerData.isSelected;
464 this.isActive = this.layerData.isActive; 420 this.isActive = this.layerData.isActive;
465 this.isStyleCollapsed = this.layerData.isStyleCollapsed; 421 this.isStyleCollapsed = this.layerData.isStyleCollapsed;
@@ -471,7 +427,7 @@ var Layer = exports.Layer = Montage.create(Component, {
471 this.dtextScaleX = this.layerData.dtextScaleX; 427 this.dtextScaleX = this.layerData.dtextScaleX;
472 this.dtextScaleY = this.layerData.dtextScaleY; 428 this.dtextScaleY = this.layerData.dtextScaleY;
473 this.dtextRotate = this.layerData.dtextRotate; 429 this.dtextRotate = this.layerData.dtextRotate;
474 this._isFirstDraw = this.layerData._isFirstDraw; 430 //this._isFirstDraw = this.layerData._isFirstDraw;
475 this.layerTag = this.layerData.layerTag; 431 this.layerTag = this.layerData.layerTag;
476 this.isVisible = this.layerData.isVisible; 432 this.isVisible = this.layerData.isVisible;
477 this.isAnimated = this.layerData.isAnimated; 433 this.isAnimated = this.layerData.isAnimated;
@@ -527,7 +483,6 @@ var Layer = exports.Layer = Montage.create(Component, {
527 // Collapser event handlers. 483 // Collapser event handlers.
528 this.mainCollapser.clicker.addEventListener("click", this.handleMainCollapserClick.bind(this), false); 484 this.mainCollapser.clicker.addEventListener("click", this.handleMainCollapserClick.bind(this), false);
529 this.positionCollapser.clicker.addEventListener("click", this.handlePositionCollapserClick.bind(this), false); 485 this.positionCollapser.clicker.addEventListener("click", this.handlePositionCollapserClick.bind(this), false);
530 this.transformCollapser.clicker.addEventListener("click", this.handleTransformCollapserClick.bind(this), false);
531 this.styleCollapser.clicker.addEventListener("click", this.handleStyleCollapserClick.bind(this), false); 486 this.styleCollapser.clicker.addEventListener("click", this.handleStyleCollapserClick.bind(this), false);
532 487
533 // Add event listeners to add and delete style buttons 488 // Add event listeners to add and delete style buttons
@@ -549,10 +504,14 @@ var Layer = exports.Layer = Montage.create(Component, {
549 }, 504 },
550 draw: { 505 draw: {
551 value: function() { 506 value: function() {
552 if (this.isSelected) { 507 var boolHasClass = this.element.classList.contains("layerSelected");
553 this.element.classList.add("selected"); 508 if (this.isSelected && !boolHasClass) {
554 } else { 509 //console.log('Layer.draw, adding selection for layer ', this.layerName)
555 this.element.classList.remove("selected"); 510 this.element.classList.add("layerSelected");
511 }
512 if (!this.isSelected && boolHasClass) {
513 //console.log('Layer.draw, removing selection for layer ', this.layerName)
514 this.element.classList.remove("layerSelected");