aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-rwxr-xr-xjs/components/layout/bread-crumb.reel/bread-crumb.js4
-rw-r--r--js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js105
-rw-r--r--js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js4
-rwxr-xr-xjs/tools/SelectionTool.js4
4 files changed, 36 insertions, 81 deletions
diff --git a/js/components/layout/bread-crumb.reel/bread-crumb.js b/js/components/layout/bread-crumb.reel/bread-crumb.js
index 4776265a..faf5e2f8 100755
--- a/js/components/layout/bread-crumb.reel/bread-crumb.js
+++ b/js/components/layout/bread-crumb.reel/bread-crumb.js
@@ -71,7 +71,7 @@ exports.Breadcrumb = Montage.create(Component, {
71 71
72 // This is always the top container which is now hardcoded to body 72 // This is always the top container which is now hardcoded to body
73 this.containerElements.unshift({"node": parentNode, "nodeUuid":parentNode.uuid, "label": "Body"}); 73 this.containerElements.unshift({"node": parentNode, "nodeUuid":parentNode.uuid, "label": "Body"});
74 74 NJevent("breadCrumbBinding",this)
75 75
76 76
77 } 77 }
@@ -80,7 +80,7 @@ exports.Breadcrumb = Montage.create(Component, {
80 handleAction: { 80 handleAction: {
81 value: function(evt) { 81 value: function(evt) {
82 82
83 this.application.ninja.breadCrumbClick=true; 83 this.application.ninja.currentDocument.breadCrumbClick=true;
84 if(evt.target.value === this.container.uuid) { 84 if(evt.target.value === this.container.uuid) {
85 return; 85 return;
86 } 86 }
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
index 33b99760..7fb57396 100644
--- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
+++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
@@ -26,6 +26,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
26 return this._arrLayers; 26 return this._arrLayers;
27 }, 27 },
28 set:function (newVal) { 28 set:function (newVal) {
29// debugger;
29 this._arrLayers = newVal; 30 this._arrLayers = newVal;
30 this.needsDraw = true; 31 this.needsDraw = true;
31 this.cacheTimeline(); 32 this.cacheTimeline();
@@ -134,16 +135,6 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
134 } 135 }
135 }, 136 },
136 137
137 tweenarray:{
138 value:[],
139 writable:true
140 },
141
142 tempArray:{
143 value:[],
144 writable:true
145 },
146
147 _masterDuration:{ 138 _masterDuration:{
148 serializable:true, 139 serializable:true,
149 value:0 140 value:0
@@ -203,22 +194,6 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
203 } 194 }
204 }, 195 },
205 196
206 _breadCrumbContainer:{
207 value:null
208 },
209
210 breadCrumbContainer:{
211 get:function () {
212 return this._breadCrumbContainer;
213 },
214 set:function (value) {
215 if (this._breadCrumbContainer !== value) {
216 this._breadCrumbContainer = value;
217 this.LayerBinding();
218 }
219 }
220 },
221
222 _isLayer:{ 197 _isLayer:{
223 value:false 198 value:false
224 }, 199 },
@@ -314,6 +289,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
314 this.eventManager.addEventListener("onOpenDocument", this.handleDocumentChange.bind(this), false); 289 this.eventManager.addEventListener("onOpenDocument", this.handleDocumentChange.bind(this), false);
315 this.eventManager.addEventListener("closeDocument", this.handleDocumentChange.bind(this), false); 290 this.eventManager.addEventListener("closeDocument", this.handleDocumentChange.bind(this), false);
316 this.eventManager.addEventListener("switchDocument", this.handleDocumentChange.bind(this), false); 291 this.eventManager.addEventListener("switchDocument", this.handleDocumentChange.bind(this), false);
292 this.eventManager.addEventListener("breadCrumbBinding",this,false);
317 293
318 // Bind drag and drop event handlers 294 // Bind drag and drop event handlers
319 this.container_layers.addEventListener("dragstart", this.handleLayerDragStart.bind(this), false); 295 this.container_layers.addEventListener("dragstart", this.handleLayerDragStart.bind(this), false);
@@ -327,6 +303,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
327 this.checkable_absolute.addEventListener("click", this.handleAbsoluteClick.bind(this), false); 303 this.checkable_absolute.addEventListener("click", this.handleAbsoluteClick.bind(this), false);
328 this.tl_configbutton.addEventListener("click", this.handleConfigButtonClick.bind(this), false); 304 this.tl_configbutton.addEventListener("click", this.handleConfigButtonClick.bind(this), false);
329 document.addEventListener("click", this.handleDocumentClick.bind(this), false); 305 document.addEventListener("click", this.handleDocumentClick.bind(this), false);
306
330 } 307 }
331 }, 308 },
332 309
@@ -422,9 +399,9 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
422 if (this._boolCacheArrays) { 399 if (this._boolCacheArrays) {
423 // ... but only if we're supposed to. 400 // ... but only if we're supposed to.
424 this.application.ninja.currentDocument.tlArrLayers = this.arrLayers; 401 this.application.ninja.currentDocument.tlArrLayers = this.arrLayers;
425 this.application.ninja.currentDocument.tlCurrentSelectedContainer = this.currentSelectedContainer; 402 this.application.ninja.currentDocument.tlCurrentSelectedContainer = this.application.ninja.currentSelectedContainer;
426 this.application.ninja.currentDocument.tllayerNumber = this.currentLayerNumber; 403 this.application.ninja.currentDocument.tllayerNumber = this.currentLayerNumber;
427 this.application.ninja.currentDocument.tlCurrentLayerSelected = this.currentLayerSelected; 404 this.application.ninja.currentDocument.tlCurrentLayerSelected = this.currentLayerSelected;
428 } 405 }
429 } 406 }
430 }, 407 },
@@ -502,19 +479,12 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
502 for (i = 0; i < arrEventsLength; i++) { 479 for (i = 0; i < arrEventsLength; i++) {
503 this.eventManager.removeEventListener(arrEvents[i], this, false); 480 this.eventManager.removeEventListener(arrEvents[i], this, false);
504 } 481 }
505 if (this._bindingDescriptors !== null) { 482
506 //console.log('Unbinding breadcrumbcontainer')
507 Object.deleteBinding(this, "breadCrumbContainer");
508 }
509 } else { 483 } else {
510 for (i = 0; i < arrEventsLength; i++) { 484 for (i = 0; i < arrEventsLength; i++) {
511 this.eventManager.addEventListener(arrEvents[i], this, false); 485 this.eventManager.addEventListener(arrEvents[i], this, false);
512 } 486 }
513 Object.defineBinding(this, "breadCrumbContainer", { 487
514 boundObject:this.application.ninja,
515 boundObjectPropertyPath:"currentSelectedContainer",
516 oneway:true
517 });
518 } 488 }
519 } 489 }
520 }, 490 },
@@ -532,18 +502,8 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
532 this.playhead.addEventListener("mousedown", this.startPlayheadTracking.bind(this), false); 502 this.playhead.addEventListener("mousedown", this.startPlayheadTracking.bind(this), false);
533 this.playhead.addEventListener("mouseup", this.stopPlayheadTracking.bind(this), false); 503 this.playhead.addEventListener("mouseup", this.stopPlayheadTracking.bind(this), false);
534 this.time_markers.addEventListener("click", this.updatePlayhead.bind(this), false); 504 this.time_markers.addEventListener("click", this.updatePlayhead.bind(this), false);
535 505
536 // Initialize BreadCrumb 506
537 this.application.ninja.breadCrumbClick = false;
538 this.enablePanel(false);
539
540 /*
541 Object.defineBinding(this, "breadCrumbContainer", {
542 boundObject:this.application.ninja,
543 boundObjectPropertyPath:"currentSelectedContainer",
544 oneway:true
545 });
546 */
547 } 507 }
548 }, 508 },
549 509
@@ -551,13 +511,16 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
551 // Called when a document is opened (new or existing), or when documents are switched. 511 // Called when a document is opened (new or existing), or when documents are switched.
552 initTimelineForDocument:{ 512 initTimelineForDocument:{
553 value:function () { 513 value:function () {
514 if(this.application.ninja.currentDocument.breadCrumbClick === undefined){
515 this.application.ninja.currentDocument.breadCrumbClick = false;
516 }
554 var myIndex, 517 var myIndex,
555 boolAlreadyInitialized = false; 518 boolAlreadyInitialized = false;
556 this.drawTimeMarkers(); 519 this.drawTimeMarkers();
557 // Document switching 520 // Document switching
558 // Check to see if we have saved timeline information in the currentDocument. 521 // Check to see if we have saved timeline information in the currentDocument.
559 if ((typeof(this.application.ninja.currentDocument.isTimelineInitialized) === "undefined") && 522 if ((typeof(this.application.ninja.currentDocument.isTimelineInitialized) === "undefined") &&
560 (!this.application.ninja.breadCrumbClick)) { 523 (!this.application.ninja.currentDocument.breadCrumbClick)) {
561 //console.log('TimelinePanel.initTimelineForDocument: new Document'); 524 //console.log('TimelinePanel.initTimelineForDocument: new Document');
562 // No, we have no information stored. 525 // No, we have no information stored.
563 // This could mean we are creating a new file, OR are opening an existing file. 526 // This could mean we are creating a new file, OR are opening an existing file.
@@ -584,7 +547,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
584 this.currentLayerNumber = this.arrLayers.length; 547 this.currentLayerNumber = this.arrLayers.length;
585 boolAlreadyInitialized = true; 548 boolAlreadyInitialized = true;
586 549
587 } else if (this.application.ninja.breadCrumbClick) { 550 } else if (this.application.ninja.currentDocument.breadCrumbClick) {
588 //console.log('TimelinePanel.initTimelineForDocument: breadCrumbClick'); 551 //console.log('TimelinePanel.initTimelineForDocument: breadCrumbClick');
589 // Information stored, but we're moving up or down in the breadcrumb. 552 // Information stored, but we're moving up or down in the breadcrumb.
590 // Get the current selection and restore timeline info for its children.