aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Timeline/TimelinePanel.reel
diff options
context:
space:
mode:
authorJonathan Duran2012-04-19 13:58:42 -0700
committerJonathan Duran2012-04-19 13:58:42 -0700
commit4465a66996f2b022ab9e838e028415fd87cfa405 (patch)
treeea8404b7dd06f40407a9ed70118362b38697a733 /js/panels/Timeline/TimelinePanel.reel
parent978c53b8e1e2476bb47c15717bf2bb3aacf3948d (diff)
parentb7d5b9e9b69644cdafdcc9b7ef2fe2674f35db18 (diff)
downloadninja-4465a66996f2b022ab9e838e028415fd87cfa405.tar.gz
Merge branch 'timeline-local' of github.com:ntfx47/ninja-internal into TimelineUber
Diffstat (limited to 'js/panels/Timeline/TimelinePanel.reel')
-rw-r--r--js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js105
1 files changed, 30 insertions, 75 deletions
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. 553 // Get the current selection and restore timeline info for its children.
@@ -594,16 +557,16 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
594 557
595 for (myIndex = 0; parentNode.children[myIndex]; myIndex++) { 558 for (myIndex = 0; parentNode.children[myIndex]; myIndex++) {
596 this._openDoc = true; 559 this._openDoc = true;
560 this.application.ninja.currentDocument.breadCrumbClick = false;
597 this.restoreLayer(parentNode.children[myIndex]); 561 this.restoreLayer(parentNode.children[myIndex]);
562
598 } 563 }
599 564 this.application.ninja.currentDocument.breadCrumbClick = false;
600 // Draw the repetition. 565 // Draw the repetition.
601 this.arrLayers = this.temparrLayers; 566 this.arrLayers = this.temparrLayers;
602 this.currentLayerNumber = storedCurrentLayerNumber; 567 this.currentLayerNumber = storedCurrentLayerNumber;
603 this.currentLayerSelected = this.application.ninja.currentSelectedContainer;
604 // this.application.ninja.breadCrumbClick = false;
605 boolAlreadyInitialized = true; 568 boolAlreadyInitialized = true;
606