diff options
Diffstat (limited to 'js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js')
-rw-r--r-- | js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | 105 |
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 0062affe..7ee0ca16 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | |||
@@ -29,6 +29,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
29 | return this._arrLayers; | 29 | return this._arrLayers; |
30 | }, | 30 | }, |
31 | set:function (newVal) { | 31 | set:function (newVal) { |
32 | // debugger; | ||
32 | this._arrLayers = newVal; | 33 | this._arrLayers = newVal; |
33 | this.needsDraw = true; | 34 | this.needsDraw = true; |
34 | this.cacheTimeline(); | 35 | this.cacheTimeline(); |
@@ -137,16 +138,6 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
137 | } | 138 | } |
138 | }, | 139 | }, |
139 | 140 | ||
140 | tweenarray:{ | ||
141 | value:[], | ||
142 | writable:true | ||
143 | }, | ||
144 | |||
145 | tempArray:{ | ||
146 | value:[], | ||
147 | writable:true | ||
148 | }, | ||
149 | |||
150 | _masterDuration:{ | 141 | _masterDuration:{ |
151 | serializable:true, | 142 | serializable:true, |
152 | value:0 | 143 | value:0 |
@@ -206,22 +197,6 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
206 | } | 197 | } |
207 | }, | 198 | }, |
208 | 199 | ||
209 | _breadCrumbContainer:{ | ||
210 | value:null | ||
211 | }, | ||
212 | |||
213 | breadCrumbContainer:{ | ||
214 | get:function () { | ||
215 | return this._breadCrumbContainer; | ||
216 | }, | ||
217 | set:function (value) { | ||
218 | if (this._breadCrumbContainer !== value) { | ||
219 | this._breadCrumbContainer = value; | ||
220 | this.LayerBinding(); | ||
221 | } | ||
222 | } | ||
223 | }, | ||
224 | |||
225 | _isLayer:{ | 200 | _isLayer:{ |
226 | value:false | 201 | value:false |
227 | }, | 202 | }, |
@@ -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 | 569 | ||
607 | } else { | 570 | } else { |
608 | //console.log('TimelinePanel.initTimelineForDocument: else fallback'); | 571 | //console.log('TimelinePanel.initTimelineForDocument: else fallback'); |
609 | // we do have information stored. Use it. |