aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js128
-rw-r--r--js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js7
2 files changed, 96 insertions, 39 deletions
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
index a1e320c4..528d1fbf 100644
--- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
+++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
@@ -68,7 +68,6 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
68 value: function() { 68 value: function() {
69 if (this._boolCacheArrays) { 69 if (this._boolCacheArrays) {
70 this.application.ninja.currentDocument.tlArrLayers = this.arrLayers; 70 this.application.ninja.currentDocument.tlArrLayers = this.arrLayers;
71
72 } 71 }
73 } 72 }
74 }, 73 },
@@ -102,6 +101,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
102 } 101 }
103 }, 102 },
104 103
104 // TODO - Remove hash tables
105 _hashKey:{ 105 _hashKey:{
106 value:0 106 value:0
107 }, 107 },
@@ -126,6 +126,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
126 } 126 }
127 }, 127 },
128 128
129
129 _currentLayerSelected:{ 130 _currentLayerSelected:{
130 value: null 131 value: null
131 }, 132 },
@@ -156,7 +157,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
156 var selectIndex = this.getLayerIndexByID(newVal); 157 var selectIndex = this.getLayerIndexByID(newVal);
157 this._selectedLayerID = newVal; 158 this._selectedLayerID = newVal;
158 this._captureSelection = true; 159 this._captureSelection = true;
159 this.selectLayer(selectIndex, true); 160 this.selectLayer(selectIndex);
160 } 161 }
161 } 162 }
162 }, 163 },
@@ -226,17 +227,17 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
226 227
227 _breadCrumbContainer:{ 228 _breadCrumbContainer:{
228 value:null 229 value:null
229 }, 230 },
230 231
231 breadCrumbContainer: { 232 breadCrumbContainer: {
233 get: function() {
234 return this._breadCrumbContainer;
235 },
232 set: function(value) { 236 set: function(value) {
233 if(this._breadCrumbContainer !== value) { 237 if(this._breadCrumbContainer !== value) {
234 this._breadCrumbContainer = value; 238 this._breadCrumbContainer = value;
235 this.LayerBinding(this.application.ninja.currentSelectedContainer); 239 this.LayerBinding(this.application.ninja.currentSelectedContainer);
236 } 240 }
237 },
238 get: function() {
239 return this._breadCrumbContainer;
240 } 241 }
241 }, 242 },
242 243
@@ -346,10 +347,12 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
346 value: function() { 347 value: function() {
347 this.layout_tracks = this.element.querySelector(".layout-tracks"); 348 this.layout_tracks = this.element.querySelector(".layout-tracks");
348 this.layout_markers = this.element.querySelector(".layout_markers"); 349 this.layout_markers = this.element.querySelector(".layout_markers");
349 this.newlayer_button.identifier = "addLayer"; 350
350 this.newlayer_button.addEventListener("click", this, false); 351 //this.newlayer_button.identifier = "addLayer";
351 this.deletelayer_button.identifier = "deleteLayer"; 352 //this.newlayer_button.addEventListener("click", this, false);
352 this.deletelayer_button.addEventListener("click", this, false); 353 //this.deletelayer_button.identifier = "deleteLayer";
354 //this.deletelayer_button.addEventListener("click", this, false);
355
353 this.timeline_leftpane.addEventListener("click", this.timelineLeftPaneClick.bind(this), false); 356 this.timeline_leftpane.addEventListener("click", this.timelineLeftPaneClick.bind(this), false);
354 this.layout_tracks.addEventListener("scroll", this.updateLayerScroll.bind(this), false); 357 this.layout_tracks.addEventListener("scroll", this.updateLayerScroll.bind(this), false);
355 this.user_layers.addEventListener("scroll", this.updateLayerScroll.bind(this), false); 358 this.user_layers.addEventListener("scroll", this.updateLayerScroll.bind(this), false);
@@ -374,8 +377,13 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
374 this.application.ninja.currentDocument.isTimelineInitialized = true; 377 this.application.ninja.currentDocument.isTimelineInitialized = true;
375 this.application.ninja.currentDocument.tlArrLayers = []; 378 this.application.ninja.currentDocument.tlArrLayers = [];
376 this.application.ninja.currentDocument.tllayerNumber = 0; 379 this.application.ninja.currentDocument.tllayerNumber = 0;
380
381 // TODO - Remove hash
377 this.application.ninja.currentDocument.tlLayerHashTable=[]; 382 this.application.ninja.currentDocument.tlLayerHashTable=[];
383
378 this.temparrLayers = []; 384 this.temparrLayers = [];
385
386 // TODO - Remove hash
379 this.hashKey = this.application.ninja.currentSelectedContainer.uuid; 387 this.hashKey = this.application.ninja.currentSelectedContainer.uuid;
380 388
381 // Are we creating a new doc, or opening an existing one? 389 // Are we creating a new doc, or opening an existing one?
@@ -391,24 +399,26 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
391 } 399 }
392 } else { 400 } else {
393 // No, it has no DOM elements. Build an empty layer object. 401 // No, it has no DOM elements. Build an empty layer object.
394 this.restoreLayer(1); 402 //this.restoreLayer(1);
395 } 403 }
396 404
397 // Feed the new array of objects into the repetitions 405 // Feed the new array of objects into the repetitions
398 // and select the first layer. 406 // and select the first layer.
399 this.temparrLayers[0].layerData.isSelected = true; 407 //this.temparrLayers[0].layerData.isSelected = true;
400 this.temparrLayers[0].layerData._isFirstDraw = true; 408 //this.temparrLayers[0].layerData._isFirstDraw = true;
401 409
402 this.arrLayers=this.temparrLayers; 410 this.arrLayers=this.temparrLayers;
403 411
404 } else { 412 } else {
405 // New document. Create default layer. 413 // New document. Create default layer.
406 this.createNewLayer(1); 414 //this.createNewLayer(1);
407 } 415 }
408 416
409 // After recreating the tracks and layers, store the result in the currentDocument. 417 // After recreating the tracks and layers, store the result in the currentDocument.
410 this.application.ninja.currentDocument.tlArrLayers = this.arrLayers; 418 this.application.ninja.currentDocument.tlArrLayers = this.arrLayers;
411 this.application.ninja.currentDocument.tllayerNumber = this.currentLayerNumber; 419 this.application.ninja.currentDocument.tllayerNumber = this.currentLayerNumber;
420
421 // TODO - Remove both hashes?
412 this.application.ninja.currentDocument.tlLayerHashTable = this.hashInstance; 422 this.application.ninja.currentDocument.tlLayerHashTable = this.hashInstance;
413 this.application.ninja.currentDocument.tlElementHashTable = this.hashElementMapToLayer; 423 this.application.ninja.currentDocument.tlElementHashTable = this.hashElementMapToLayer;
414 this.application.ninja.currentDocument.hashKey=this.hashKey; 424 this.application.ninja.currentDocument.hashKey=this.hashKey;
@@ -427,6 +437,8 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
427 this.arrLayers = this.application.ninja.currentDocument.tlArrLayers; 437 this.arrLayers = this.application.ninja.currentDocument.tlArrLayers;
428 this.currentLayerNumber = this.application.ninja.currentDocument.tllayerNumber; 438 this.currentLayerNumber = this.application.ninja.currentDocument.tllayerNumber;
429 this.currentLayerSelected = this.application.ninja.currentDocument.tlCurrentLayerSelected; 439 this.currentLayerSelected = this.application.ninja.currentDocument.tlCurrentLayerSelected;
440
441 // TODO - remove hash
430 this.hashInstance = this.application.ninja.currentDocument.tlLayerHashTable; 442 this.hashInstance = this.application.ninja.currentDocument.tlLayerHashTable;
431 this.hashElementMapToLayer = this.application.ninja.currentDocument.tlElementHashTable; 443 this.hashElementMapToLayer = this.application.ninja.currentDocument.tlElementHashTable;
432 this.hashKey = this.application.ninja.currentDocument.hashKey; 444 this.hashKey = this.application.ninja.currentDocument.hashKey;
@@ -452,8 +464,8 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
452 this.timebar.style.width = "0px"; 464 this.timebar.style.width = "0px";
453 465
454 // Clear variables. 466 // Clear variables.
455 this.hashInstance = null; 467 this.hashInstance = null; // TODO - remove hash
456 this.hashElementMapToLayer = null; 468 this.hashElementMapToLayer = null; // TODO - remove hash
457 this.currentLayerNumber = 0; 469 this.currentLayerNumber = 0;
458 this.currentLayerSelected = false; 470 this.currentLayerSelected = false;
459 this.selectedKeyframes = []; 471 this.selectedKeyframes = [];
@@ -481,7 +493,8 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
481 493
482 // Rebind the document events for the new document context 494 // Rebind the document events for the new document context
483 this._bindDocumentEvents(); 495 this._bindDocumentEvents();
484 496
497 // TODO - remove hash
485 this.hashInstance = this.createLayerHashTable(); 498 this.hashInstance = this.createLayerHashTable();
486 this.hashElementMapToLayer = this.createElementMapToLayer(); 499 this.hashElementMapToLayer = this.createElementMapToLayer();
487 500
@@ -541,8 +554,12 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
541 value:function(){ 554 value:function(){
542 var key , switchSelectedLayer,layerIndex; 555 var key , switchSelectedLayer,layerIndex;
543 this.deselectTweens(); 556 this.deselectTweens();
557
544 if(this.application.ninja.selectedElements[0]){ 558 if(this.application.ninja.selectedElements[0]){
559
560 // TODO - element uuid should be stored directly in layer array (possibly as the layerID)
545 key = this.application.ninja.selectedElements[0].uuid; 561 key = this.application.ninja.selectedElements[0].uuid;
562
546 switchSelectedLayer = this.hashElementMapToLayer.getItem(key); 563 switchSelectedLayer = this.hashElementMapToLayer.getItem(key);
547 if(switchSelectedLayer!==undefined){ 564 if(switchSelectedLayer!==undefined){
548 layerIndex = this.getLayerIndexByID(switchSelectedLayer.layerID); 565 layerIndex = this.getLayerIndexByID(switchSelectedLayer.layerID);
@@ -622,11 +639,14 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
622 this._firstTimeLoaded = false; 639 this._firstTimeLoaded = false;