aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--js/panels/Timeline/Layer.reel/Layer.js48
-rw-r--r--js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js11
2 files changed, 31 insertions, 28 deletions
diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js
index 36c77018..5b1ce594 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,
@@ -555,10 +566,15 @@ var Layer = exports.Layer = Montage.create(Component, {
555 }, 566 },
556 didDraw: { 567 didDraw: {
557 value: function() { 568 value: function() {
558 if ((this.isSelected === true) && (this._isFirstDraw === true)) { 569 if (this._isFirstDraw === true) {
559 // Once we're done drawing the first time we need to tell the TimelinePanel if 570 if (this.isSelected === true) {
560 // this layer is supposed to be selected. 571 if (this.application.ninja.currentDocument._uuid === this._docUUID) {
561 this.parentComponent.parentComponent.selectedLayerID = this.layerID; 572 // Once we're done drawing the first time we need to tell the TimelinePanel if
573 // this layer is supposed to be selected.
574 //console.log('layerName ' + this.layerName);
575 this.parentComponent.parentComponent.selectedLayerID = this.layerID;
576 }
577 }
562 this._isFirstDraw = false; 578 this._isFirstDraw = false;
563 } 579 }
564 } 580 }
@@ -567,36 +583,16 @@ var Layer = exports.Layer = Montage.create(Component, {
567 583
568 /* Begin: Controllers */ 584 /* Begin: Controllers */
569 585
570 // Initialize a just-created layer with some basic defaults and needed selectors. 586 // Initialize a just-created layer
571 init: { 587 init: {
572 value: function() { 588 value: function() {
573 // Default some vars
574 //this.arrLayerStyles = [];
575
576 // Get some selectors. 589 // Get some selectors.
577 this.label = this.element.querySelector(".label-layer"); 590 this.label = this.element.querySelector(".label-layer");
578 this.titleSelector = this.label.querySelector(".collapsible-label"); 591 this.titleSelector = this.label.querySelector(".collapsible-label");
579 this.buttonAddStyle = this.element.querySelector(".button-add"); 592 this.buttonAddStyle = this.element.querySelector(".button-add");
580 this.buttonDeleteStyle = this.element.querySelector(".button-delete"); 593 this.buttonDeleteStyle = this.element.querySelector(".button-delete");
581
582
583
584 } 594 }
585 }, 595 },
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 : { 596 addStyle : {
601 value: function() { 597 value: function() {
602 // Add a new style rule. It should be added above the currently selected rule, 598 // Add a new style rule. It should be added above the currently selected rule,
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
index 7fb57396..0b688139 100644
--- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
+++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
@@ -113,7 +113,9 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
113 var selectIndex = this.getLayerIndexByID(newVal); 113 var selectIndex = this.getLayerIndexByID(newVal);
114 this._selectedLayerID = newVal; 114 this._selectedLayerID = newVal;
115 this._captureSelection = true; 115 this._captureSelection = true;
116 this.selectLayer(selectIndex); 116 //console.log(selectIndex);
117 //debugger;
118 this.selectLayer(selectIndex, true);
117 } 119 }
118 } 120 }
119 }, 121 },
@@ -387,6 +389,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
387 returnObj.layerData.isTrackAnimated = false; 389 returnObj.layerData.isTrackAnimated = false;
388 returnObj.parentElementUUID = null; 390 returnObj.parentElementUUID = null;
389 returnObj.parentElement = null; 391 returnObj.parentElement = null;
392 returnObj.docUUID = this.application.ninja.currentDocument._uuid;
390 393
391 return returnObj; 394 return returnObj;
392 } 395 }
@@ -502,7 +505,10 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
502 this.playhead.addEventListener("mousedown", this.startPlayheadTracking.bind(this), false); 505 this.playhead.addEventListener("mousedown", this.startPlayheadTracking.bind(this), false);
503 this.playhead.addEventListener("mouseup", this.stopPlayheadTracking.bind(this), false); 506 this.playhead.addEventListener("mouseup", this.stopPlayheadTracking.bind(this), false);
504 this.time_markers.addEventListener("click", this.updatePlayhead.bind(this), false); 507 this.time_markers.addEventListener("click", this.updatePlayhead.bind(this), false);
505 508
509 // Initialize BreadCrumb
510 this.application.ninja.breadCrumbClick = false;
511 this.enablePanel(false);
506 512
507 } 513 }
508 }, 514 },
@@ -646,6 +652,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
646 // Clear the timeline but not the cache 652 // Clear the timeline but not the cache
647 //console.log('TimelinePanel.handleDocumentChange'); 653 //console.log('TimelinePanel.handleDocumentChange');
648 if ((event.type === "closeDocument") && (this.application.ninja.documentController._documents.length > 0)) { 654 if ((event.type === "closeDocument") && (this.application.ninja.documentController._documents.length > 0)) {
655 // Ignore extra closeDocument event that fires while there are still documents open.
649 return; 656 return;
650 } 657 }
651 this._boolCacheArrays = false; 658 this._boolCacheArrays = false;