diff options
author | Jonathan Duran | 2012-04-20 07:54:39 -0700 |
---|---|---|
committer | Jonathan Duran | 2012-04-20 07:54:39 -0700 |
commit | 92791b40eed712aa6e341fc303b0d2ab19940777 (patch) | |
tree | 26d48632a13686ff3895ba63998d169783d0ffae /js/panels/Timeline/Layer.reel | |
parent | 2e27ce188f77ea1d4ef8a9c08bc853179c3f7c8b (diff) | |
parent | 57a0ca060f34297923e2e891ee25e5c928c09f00 (diff) | |
download | ninja-92791b40eed712aa6e341fc303b0d2ab19940777.tar.gz |
Merge branch 'refs/heads/timeline-local' into TimelineUber
Diffstat (limited to 'js/panels/Timeline/Layer.reel')
-rw-r--r-- | js/panels/Timeline/Layer.reel/Layer.js | 49 |
1 files changed, 23 insertions, 26 deletions
diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js index 36c77018..1b8d73c0 100644 --- a/js/panels/Timeline/Layer.reel/Layer.js +++ b/js/panels/Timeline/Layer.reel/Layer.js | |||
@@ -113,7 +113,18 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
113 | this.layerData.layerTag = newVal; | 113 | this.layerData.layerTag = newVal; |
114 | } | 114 | } |
115 | }, | 115 | }, |
116 | 116 | _docUUID : { | |
117 | value: null | ||
118 | }, | ||
119 | docUUID : { | ||
120 | serializable: true, | ||
121 | get: function() { | ||
122 | return this._docUUID; | ||
123 | }, | ||
124 | set: function(newVal) { | ||
125 | this._docUUID = newVal; | ||
126 | } | ||
127 | }, | ||
117 | /* Position and Transform hottext values */ | 128 | /* Position and Transform hottext values */ |
118 | _dtextPositionX : { | 129 | _dtextPositionX : { |
119 | value:null, | 130 | value:null, |
@@ -471,6 +482,7 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
471 | this.layerTag = this.layerData.layerTag; | 482 | this.layerTag = this.layerData.layerTag; |
472 | this.isVisible = this.layerData.isVisible; | 483 | this.isVisible = this.layerData.isVisible; |
473 | this.isAnimated = this.layerData.isAnimated; | 484 | this.isAnimated = this.layerData.isAnimated; |
485 | this.docUUID = this.layerData.docUUID; | ||
474 | this.needsDraw = boolNeedsDraw; | 486 | this.needsDraw = boolNeedsDraw; |
475 | } | 487 | } |
476 | }, | 488 | }, |
@@ -555,10 +567,15 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
555 | }, | 567 | }, |
556 | didDraw: { | 568 | didDraw: { |
557 | value: function() { | 569 | value: function() { |
558 | if ((this.isSelected === true) && (this._isFirstDraw === true)) { | 570 | if (this._isFirstDraw === true) { |
559 | // Once we're done drawing the first time we need to tell the TimelinePanel if | 571 | if (this.isSelected === true) { |
560 | // this layer is supposed to be selected. | 572 | if (this.application.ninja.currentDocument._uuid === this._docUUID) { |
561 | this.parentComponent.parentComponent.selectedLayerID = this.layerID; | 573 | // Once we're done drawing the first time we need to tell the TimelinePanel if |
574 | // this layer is supposed to be selected. | ||
575 | //console.log('layerName ' + this.layerName); | ||
576 | this.parentComponent.parentComponent.selectedLayerID = this.layerID; | ||
577 | } | ||
578 | } | ||
562 | this._isFirstDraw = false; | 579 | this._isFirstDraw = false; |
563 | } | 580 | } |
564 | } | 581 | } |
@@ -567,36 +584,16 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
567 | 584 | ||
568 | /* Begin: Controllers */ | 585 | /* Begin: Controllers */ |
569 | 586 | ||
570 | // Initialize a just-created layer with some basic defaults and needed selectors. | 587 | // Initialize a just-created layer |
571 | init: { | 588 | init: { |
572 | value: function() { | 589 | value: function() { |
573 | // Default some vars | ||
574 | //this.arrLayerStyles = []; | ||
575 | |||
576 | // Get some selectors. | 590 | // Get some selectors. |
577 | this.label = this.element.querySelector(".label-layer"); | 591 | this.label = this.element.querySelector(".label-layer"); |
578 | this.titleSelector = this.label.querySelector(".collapsible-label"); | 592 | this.titleSelector = this.label.querySelector(".collapsible-label"); |
579 | this.buttonAddStyle = this.element.querySelector(".button-add"); | 593 | this.buttonAddStyle = this.element.querySelector(".button-add"); |
580 | this.buttonDeleteStyle = this.element.querySelector(".button-delete"); | 594 | this.buttonDeleteStyle = this.element.querySelector(".button-delete"); |
581 | |||
582 | |||
583 | |||
584 | } | 595 | } |
585 | }, | 596 | }, |
586 | selectLayer:{ | ||
587 | value:function(){ | ||
588 | // this.mainCollapser.header.classList.add("layerSelected"); | ||
589 | this.element.classList.add("layerSelected"); | ||
590 | this.isSelected = true; | ||
591 | } | ||
592 | }, | ||
593 | deselectLayer:{ | ||
594 | value:function(){ | ||
595 | // this.mainCollapser.header.classList.remove("layerSelected"); | ||
596 | this.element.classList.remove("layerSelected"); | ||
597 | this.isSelected = false; | ||
598 | } | ||
599 | }, | ||
600 | addStyle : { | 597 | addStyle : { |
601 | value: function() { | 598 | value: function() { |
602 | // Add a new style rule. It should be added above the currently selected rule, | 599 | // Add a new style rule. It should be added above the currently selected rule, |