diff options
Diffstat (limited to 'js/panels/Timeline/Layer.reel/Layer.js')
-rw-r--r-- | js/panels/Timeline/Layer.reel/Layer.js | 83 |
1 files changed, 65 insertions, 18 deletions
diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js index bddfcd3e..9cf321b1 100644 --- a/js/panels/Timeline/Layer.reel/Layer.js +++ b/js/panels/Timeline/Layer.reel/Layer.js | |||
@@ -102,6 +102,7 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
102 | }, | 102 | }, |
103 | set:function(value){ | 103 | set:function(value){ |
104 | this._layerID = value; | 104 | this._layerID = value; |
105 | this.layerData.layerID = value; | ||
105 | } | 106 | } |
106 | }, | 107 | }, |
107 | 108 | ||
@@ -119,7 +120,7 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
119 | set:function(value){ | 120 | set:function(value){ |
120 | if (this._dtextPositionX !== value) { | 121 | if (this._dtextPositionX !== value) { |
121 | this._dtextPositionX = value; | 122 | this._dtextPositionX = value; |
122 | //this.needsDraw = true; | 123 | this.layerData.dtextPositionX = value; |
123 | } | 124 | } |
124 | 125 | ||
125 | } | 126 | } |
@@ -138,7 +139,7 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
138 | set:function(value){ | 139 | set:function(value){ |
139 | if (this._dtextPositionY !== value) { | 140 | if (this._dtextPositionY !== value) { |
140 | this._dtextPositionY = value; | 141 | this._dtextPositionY = value; |
141 | //this.needsDraw = true; | 142 | this.layerData.dtextPositionY = value; |
142 | } | 143 | } |
143 | 144 | ||
144 | } | 145 | } |
@@ -157,7 +158,7 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
157 | set:function(value){ | 158 | set:function(value){ |
158 | if (this._dtextScaleX !== value) { | 159 | if (this._dtextScaleX !== value) { |
159 | this._dtextScaleX = value; | 160 | this._dtextScaleX = value; |
160 | //this.needsDraw = true; | 161 | this.layerData.dtextScaleX = value; |
161 | } | 162 | } |
162 | 163 | ||
163 | } | 164 | } |
@@ -176,7 +177,7 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
176 | set:function(value){ | 177 | set:function(value){ |
177 | if (this._dtextScaleY !== value) { | 178 | if (this._dtextScaleY !== value) { |
178 | this._dtextScaleY = value; | 179 | this._dtextScaleY = value; |
179 | //this.needsDraw = true; | 180 | this.layerData.dtextScaleY = value; |
180 | } | 181 | } |
181 | 182 | ||
182 | } | 183 | } |
@@ -195,7 +196,7 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
195 | set:function(value){ | 196 | set:function(value){ |
196 | if (this._dtextSkewX !== value) { | 197 | if (this._dtextSkewX !== value) { |
197 | this._dtextSkewX = value; | 198 | this._dtextSkewX = value; |
198 | //this.needsDraw = true; | 199 | this.layerData.dtextSkewX = value; |
199 | } | 200 | } |
200 | 201 | ||
201 | } | 202 | } |
@@ -214,7 +215,7 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
214 | set:function(value){ | 215 | set:function(value){ |
215 | if (this._dtextSkewY !== value) { | 216 | if (this._dtextSkewY !== value) { |
216 | this._dtextSkewY = value; | 217 | this._dtextSkewY = value; |
217 | //this.needsDraw = true; | 218 | this.layerData.dtextSkewY = value; |
218 | } | 219 | } |
219 | 220 | ||
220 | } | 221 | } |
@@ -233,7 +234,7 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
233 | set:function(value){ | 234 | set:function(value){ |
234 | if (this._dtextRotate !== value) { | 235 | if (this._dtextRotate !== value) { |
235 | this._dtextRotate = value; | 236 | this._dtextRotate = value; |
236 | //this.needsDraw = true; | 237 | this.layerData.dtextRotate = value; |
237 | } | 238 | } |
238 | 239 | ||
239 | } | 240 | } |
@@ -278,6 +279,7 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
278 | }, | 279 | }, |
279 | set: function(newVal) { | 280 | set: function(newVal) { |
280 | this._isActive = newVal; | 281 | this._isActive = newVal; |
282 | this.layerData.isActive = newVal; | ||
281 | } | 283 | } |
282 | }, | 284 | }, |
283 | 285 | ||
@@ -294,6 +296,7 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
294 | }, | 296 | }, |
295 | set:function(value){ | 297 | set:function(value){ |
296 | this._isAnimated = value; | 298 | this._isAnimated = value; |
299 | this.layerData.isAnimated = newVal; | ||
297 | } | 300 | } |
298 | }, | 301 | }, |
299 | _justAdded: { | 302 | _justAdded: { |
@@ -384,11 +387,15 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
384 | set: function(newVal) { | 387 | set: function(newVal) { |
385 | if (newVal !== this._bypassAnimation) { | 388 | if (newVal !== this._bypassAnimation) { |
386 | this._bypassAnimation = newVal; | 389 | this._bypassAnimation = newVal; |
387 | this.layerData.bypassAnimation = newVal; | 390 | this.layerData.bypassAnimation = newVal; |
388 | //this.triggerOutgoingBinding(); | ||
389 | } | 391 | } |
390 | } | 392 | } |
391 | }, | 393 | }, |
394 | |||
395 | // Is this the first draw? | ||
396 | _isFirstDraw : { | ||
397 | value: true | ||
398 | }, | ||
392 | 399 | ||
393 | _layerData:{ | 400 | _layerData:{ |
394 | serializable:true, | 401 | serializable:true, |
@@ -459,12 +466,6 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
459 | } | 466 | } |
460 | } | 467 | } |
461 | }, | 468 | }, |
462 | |||
463 | // Is this the first draw? | ||
464 | _isFirstDraw : { | ||
465 | value: true | ||
466 | }, | ||
467 | |||
468 | /* END: Models */ | 469 | /* END: Models */ |
469 | 470 | ||
470 | /* Begin: Draw cycle */ | 471 | /* Begin: Draw cycle */ |
@@ -507,7 +508,12 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
507 | this.element.addEventListener("click", this, false); | 508 | this.element.addEventListener("click", this, false); |
508 | 509 | ||
509 | // Drag and drop event hanlders | 510 | // Drag and drop event hanlders |
510 | this.element.addEventListener("dropped", this, false); | 511 | this.element.addEventListener("mouseover", this.handleMouseover.bind(this), false); |
512 | this.element.addEventListener("mouseout", this.handleMouseout.bind(this), false); | ||
513 | this.element.addEventListener("dragover", this.handleDragover.bind(this), false); | ||
514 | this.element.addEventListener("dragleave", this.handleDragleave.bind(this), false); | ||
515 | this.element.addEventListener("dragstart", this.handleDragstart.bind(this), false); | ||
516 | this.element.addEventListener("drop", this.handleDrop.bind(this), false); | ||
511 | 517 | ||
512 | } | 518 | } |
513 | }, | 519 | }, |
@@ -545,6 +551,8 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
545 | this.titleSelector = this.label.querySelector(".collapsible-label"); | 551 | this.titleSelector = this.label.querySelector(".collapsible-label"); |
546 | this.buttonAddStyle = this.element.querySelector(".button-add"); | 552 | this.buttonAddStyle = this.element.querySelector(".button-add"); |
547 | this.buttonDeleteStyle = this.element.querySelector(".button-delete"); | 553 | this.buttonDeleteStyle = this.element.querySelector(".button-delete"); |
554 | |||
555 | |||
548 | 556 | ||
549 | } | 557 | } |
550 | }, | 558 | }, |
@@ -786,9 +794,48 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
786 | this.triggerOutgoingBinding(); | 794 | this.triggerOutgoingBinding(); |
787 | } | 795 | } |
788 | }, | 796 | }, |
789 | handleDropped : { | 797 | handleMouseover: { |
790 | value: function(event) { | 798 | value: function(event) { |
791 | console.log('wheeee! WWEWWEWWWWEEEEEEEEE') | 799 | this.element.draggable = true; |
800 | } | ||
801 | }, | ||
802 | handleMouseout: { | ||
803 | value: function(event) { | ||
804 | this.element.draggable = false; | ||
805 | } | ||
806 | }, | ||
807 | handleDragenter: { | ||
808 | value: function(event) { | ||
809 | } | ||
810 | }, | ||
811 | handleDragleave: { | ||
812 | value: function(event) { | ||
813 | this.element.classList.remove("dragOver"); | ||
814 | } | ||
815 | }, | ||
816 | handleDragstart: { | ||
817 | value: function(event) { | ||
818 | this.parentComponent.parentComponent.dragLayerID = this.layerID; | ||
819 | event.dataTransfer.setData('Text', 'Layer'); | ||
820 | } | ||
821 | }, | ||
822 | handleDragover: { | ||
823 | value: function(event) { | ||
824 | event.preventDefault(); | ||
825 | this.element.classList.add("dragOver"); | ||
826 | event.dataTransfer.dropEffect = "move"; | ||
827 | return false; | ||
828 | } | ||
829 | }, | ||
830 | |||
831 | handleDrop : { | ||
832 | value: function(event) { | ||
833 | event.stopPropagation(); | ||
834 | this.element.classList.remove("dragOver"); | ||
835 | if (this.parentComponent.parentComponent.dragLayerID !== this.layerID) { | ||
836 | this.parentComponent.parentComponent.dropLayerID = this.layerID; | ||
837 | } | ||
< |