aboutsummaryrefslogtreecommitdiff
path: root/js/panels
diff options
context:
space:
mode:
authorAnanya Sen2012-06-12 12:09:45 -0700
committerAnanya Sen2012-06-12 12:09:45 -0700
commit3389cd085555e188800f337525c0fc8884084c04 (patch)
tree3899c1c4b8bce4ec3c05fb4b8f6f3824cd82188d /js/panels
parent1e7f318e7bbc0c3cd95217fc369ccc30963a5381 (diff)
parent6854a72504f57903bd5de003e377f2aefb02d0da (diff)
downloadninja-3389cd085555e188800f337525c0fc8884084c04.tar.gz
Merge branch 'refs/heads/ninja-internal-master' into cut-copy-paste
Diffstat (limited to 'js/panels')
-rw-r--r--js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js28
1 files changed, 15 insertions, 13 deletions
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
index d7329ac7..f7ab5117 100644
--- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
+++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
@@ -53,6 +53,14 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
53 } 53 }
54 } 54 }
55 }, 55 },
56
57 handleChange: {
58 value: function() {
59 if(this.currentDocument && this.currentDocument.model.getProperty("domContainer")) {
60 this.currentSelectedContainer = this.currentDocument.model.getProperty("domContainer");
61 }
62 }
63 },
56 64
57 _currentSelectedContainer: { 65 _currentSelectedContainer: {
58 value: null 66 value: null
@@ -405,13 +413,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
405 this.tl_configbutton.addEventListener("click", this.handleConfigButtonClick.bind(this), false); 413 this.tl_configbutton.addEventListener("click", this.handleConfigButtonClick.bind(this), false);
406 document.addEventListener("click", this.handleDocumentClick.bind(this), false); 414 document.addEventListener("click", this.handleDocumentClick.bind(this), false);
407 415
408 416 this.addPropertyChangeListener("currentDocument.model.domContainer", this);
409 // Bind some bindings
410 Object.defineBinding(this, "currentSelectedContainer", {
411 boundObject:this.application.ninja,
412 boundObjectPropertyPath:"currentSelectedContainer",
413 oneway:true
414 });
415 417
416 } 418 }
417 }, 419 },
@@ -512,7 +514,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
512 if (this._boolCacheArrays) { 514 if (this._boolCacheArrays) {
513 // ... but only if we're supposed to. 515 // ... but only if we're supposed to.
514 this.application.ninja.currentDocument.tlArrLayers = this.arrLayers; 516 this.application.ninja.currentDocument.tlArrLayers = this.arrLayers;
515 this.application.ninja.currentDocument.tlCurrentSelectedContainer = this.application.ninja.currentSelectedContainer; 517 this.application.ninja.currentDocument.tlCurrentSelectedContainer = this.currentDocument.model.domContainer;
516 this.application.ninja.currentDocument.tllayerNumber = this.currentLayerNumber; 518 this.application.ninja.currentDocument.tllayerNumber = this.currentLayerNumber;
517 this.application.ninja.currentDocument.tlCurrentLayerSelected = this.currentLayerSelected; 519 this.application.ninja.currentDocument.tlCurrentLayerSelected = this.currentLayerSelected;
518 this.application.ninja.currentDocument.tlCurrentLayersSelected = this.currentLayersSelected; 520 this.application.ninja.currentDocument.tlCurrentLayersSelected = this.currentLayersSelected;
@@ -525,7 +527,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
525 // Initialize the currentDocument for a new set of timeline data. 527 // Initialize the currentDocument for a new set of timeline data.
526 this.application.ninja.currentDocument.isTimelineInitialized = true; 528 this.application.ninja.currentDocument.isTimelineInitialized = true;
527 this.application.ninja.currentDocument.tlArrLayers = []; 529 this.application.ninja.currentDocument.tlArrLayers = [];
528 this.application.ninja.currentDocument.tlCurrentSelectedContainer = this.application.ninja.currentSelectedContainer; 530 this.application.ninja.currentDocument.tlCurrentSelectedContainer = this.currentDocument.model.domContainer;
529 this.application.ninja.currentDocument.tllayerNumber = this.currentLayerNumber; 531 this.application.ninja.currentDocument.tllayerNumber = this.currentLayerNumber;
530 this.application.ninja.currentDocument.tlCurrentLayerSelected = false; 532 this.application.ninja.currentDocument.tlCurrentLayerSelected = false;
531 this.application.ninja.currentDocument.tlCurrentLayersSelected = false; 533 this.application.ninja.currentDocument.tlCurrentLayersSelected = false;
@@ -669,7 +671,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
669 // console.log('TimelinePanel.initTimelineForDocument: breadCrumbClick'); 671 // console.log('TimelinePanel.initTimelineForDocument: breadCrumbClick');
670 // Information stored, but we're moving up or down in the breadcrumb. 672 // Information stored, but we're moving up or down in the breadcrumb.
671 // Get the current selection and restore timeline info for its children. 673 // Get the current selection and restore timeline info for its children.
672 var parentNode = this.application.ninja.currentSelectedContainer, 674 var parentNode = this.currentDocument.model.domContainer,
673 storedCurrentLayerNumber = this.application.ninja.currentDocument.tllayerNumber; 675 storedCurrentLayerNumber = this.application.ninja.currentDocument.tllayerNumber;
674 this.temparrLayers = []; 676 this.temparrLayers = [];
675 677
@@ -708,7 +710,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
708 710
709 //debugger; 711 //debugger;
710 if (typeof(this.application.ninja.currentDocument.tlCurrentSelectedContainer) !== "undefined") { 712 if (typeof(this.application.ninja.currentDocument.tlCurrentSelectedContainer) !== "undefined") {
711// this.application.ninja.currentSelectedContainer=this.application.ninja.currentDocument.tlCurrentSelectedContainer; 713// this.currentDocument.model.domContainer = this.application.ninja.currentDocument.tlCurrentSelectedContainer;
712 } 714 }
713 715
714 // Are we only showing animated layers? 716 // Are we only showing animated layers?
@@ -984,7 +986,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
984 thingToPush.layerData.layerName = newLayerName; 986 thingToPush.layerData.layerName = newLayerName;
985 thingToPush.layerData.layerTag = "<" + object.nodeName.toLowerCase() + ">"; 987 thingToPush.layerData.layerTag = "<" + object.nodeName.toLowerCase() + ">";
986 thingToPush.layerData.layerID = this.currentLayerNumber; 988 thingToPush.layerData.layerID = this.currentLayerNumber;
987 thingToPush.parentElement = this.application.ninja.currentSelectedContainer; 989 thingToPush.parentElement = this.currentDocument.model.domContainer;
988 thingToPush.layerData.isSelected = true; 990 thingToPush.layerData.isSelected = true;
989 thingToPush.layerData._isFirstDraw = true; 991 thingToPush.layerData._isFirstDraw = true;
990 thingToPush.layerData.created = true; 992 thingToPush.layerData.created = true;
@@ -1032,7 +1034,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
1032 thingToPush.layerData.layerName = newLayerName; 1034 thingToPush.layerData.layerName = newLayerName;
1033 thingToPush.layerData.layerID = this.currentLayerNumber; 1035 thingToPush.layerData.layerID = this.currentLayerNumber;
1034 thingToPush.layerData.layerTag = "<" + ele.nodeName.toLowerCase() + ">"; 1036 thingToPush.layerData.layerTag = "<" + ele.nodeName.toLowerCase() + ">";
1035 thingToPush.parentElement = this.application.ninja.currentSelectedContainer; 1037 thingToPush.parentElement = this.currentDocument.model.domContainer;
1036 if (this.checkable_animated.classList.contains("checked")) { 1038 if (this.checkable_animated.classList.contains("checked")) {
1037 thingToPush.layerData.isVisible = false; 1039 thingToPush.layerData.isVisible = false;
1038 } 1040 }