diff options
Diffstat (limited to 'js/panels')
-rw-r--r-- | js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | 89 | ||||
-rw-r--r-- | js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js | 108 |
2 files changed, 108 insertions, 89 deletions
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index 8eb2b745..1a0b9e80 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | |||
@@ -148,12 +148,12 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
148 | writable:true | 148 | writable:true |
149 | }, | 149 | }, |
150 | 150 | ||
151 | _arrLayersNonEmpty:{ | 151 | _captureSelection:{ |
152 | value:true, | 152 | value:false, |
153 | writable:true | 153 | writable:true |
154 | }, | 154 | }, |
155 | 155 | ||
156 | _captureSelection:{ | 156 | _openDoc:{ |
157 | value:false, | 157 | value:false, |
158 | writable:true | 158 | writable:true |
159 | }, | 159 | }, |
@@ -222,15 +222,18 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
222 | myIndex=0; | 222 | myIndex=0; |
223 | while(this.application.ninja.currentDocument.documentRoot.children[myIndex]) | 223 | while(this.application.ninja.currentDocument.documentRoot.children[myIndex]) |
224 | { | 224 | { |
225 | this.application.ninja.currentDocument.documentRoot.children[myIndex]; | 225 | this._openDoc=true; |
226 | NJevent('newLayer',{key:this._hashKey,element:this.application.ninja.currentDocument.documentRoot.children[myIndex]}); | 226 | NJevent('newLayer',{key:this._hashKey,ele:this.application.ninja.currentDocument.documentRoot.children[myIndex]}) |
227 | // this.selectLayer(myIndex); | ||
228 | // TimelineTrack.retrieveStoredTweens(); | ||
227 | myIndex++; | 229 | myIndex++; |
228 | } | 230 | } |
229 | }else{ | 231 | }else{ |
230 | NJevent('newLayer', this._hashKey); | 232 | NJevent('newLayer', this._hashKey); |
233 | this.selectLayer(0); | ||
234 | |||
231 | } | 235 | } |
232 | _firstLayerDraw = true; | 236 | _firstLayerDraw = true; |
233 | this.selectLayer(0); | ||
234 | } | 237 | } |
235 | }, | 238 | }, |
236 | 239 | ||
@@ -314,14 +317,14 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
314 | 317 | ||
315 | handleDeleteLayerClick:{ | 318 | handleDeleteLayerClick:{ |
316 | value:function (event) { | 319 | value:function (event) { |
317 | if (this.arrLayers.length === 1) { | 320 | if (this.arrLayers.length === 1) { |
318 | // do not delete last layer | 321 | // do not delete last layer |
319 | return; | 322 | return; |
320 | } | 323 | } |
321 | if (this.layerRepetition.selectedIndexes === null) { | 324 | if (this.layerRepetition.selectedIndexes === null) { |
322 | // nothing is selected, do not delete | 325 | // nothing is selected, do not delete |
323 | return; | 326 | return; |
324 | } | 327 | } |
325 | this._deleteKeyDown = false; | 328 | this._deleteKeyDown = false; |
326 | if (this.application.ninja.currentSelectedContainer.id === "UserContent") { | 329 | if (this.application.ninja.currentSelectedContainer.id === "UserContent") { |
327 | this._hashKey = "123"; | 330 | this._hashKey = "123"; |
@@ -333,7 +336,6 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
333 | handleLayerBinding:{ | 336 | handleLayerBinding:{ |
334 | value:function (event) { | 337 | value:function (event) { |
335 | var i = 0; | 338 | var i = 0; |
336 | this.currentParentNode = this.application.ninja.currentSelectedContainer.parentNode; | ||
337 | 339 | ||
338 | if (this._firstTimeLoaded) { | 340 | if (this._firstTimeLoaded) { |
339 | this._firstTimeLoaded = false; | 341 | this._firstTimeLoaded = false; |
@@ -371,7 +373,6 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
371 | value:function (event) { | 373 | value:function (event) { |
372 | var hashIndex = 0 , hashVariable = 0, layerResult, trackResult, layerObject, trackObject, dLayer, parentNode; | 374 | var hashIndex = 0 , hashVariable = 0, layerResult, trackResult, layerObject, trackObject, dLayer, parentNode; |
373 | 375 | ||
374 | this._arrLayersNonEmpty = true; | ||
375 | if (this._hashFind) { | 376 | if (this._hashFind) { |
376 | while (layerResult = this.returnedObject[hashIndex]) { | 377 | while (layerResult = this.returnedObject[hashIndex]) { |
377 | trackResult = this.returnedTrack[hashIndex]; | 378 | trackResult = this.returnedTrack[hashIndex]; |
@@ -393,7 +394,6 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
393 | dLayer[hashVariable].deleted = false; | 394 | dLayer[hashVariable].deleted = false; |
394 | this.arrTracks.splice(event.detail._layerPosition, 0, event.detail._track); | 395 | this.arrTracks.splice(event.detail._layerPosition, 0, event.detail._track); |
395 | this.arrLayers.splice(event.detail._layerPosition, 0, event.detail._el); | 396 | this.arrLayers.splice(event.detail._layerPosition, 0, event.detail._el); |
396 | |||
397 | break; | 397 | break; |
398 | 398 | ||
399 | } | 399 | } |
@@ -412,8 +412,8 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
412 | } | 412 | } |
413 | hashVariable++; | 413 | hashVariable++; |
414 | } | 414 | } |
415 | this._setBreadCrumb = true; | 415 | this.application.ninja.currentSelectedContainer = parentNode; |
416 | NJevent('breadCrumbTrail', {"element":parentNode, "setFlag":this._setBreadCrumb}); | 416 | //NJevent('breadCrumbTrail', {"element":parentNode, "setFlag":this._setBreadCrumb}); |
417 | } else { | 417 | } else { |
418 | dLayer = this.hashInstance.getItem(event.detail._el.parentElementUUID); | 418 | dLayer = this.hashInstance.getItem(event.detail._el.parentElementUUID); |
419 | while (dLayer[hashVariable]) { | 419 | while (dLayer[hashVariable]) { |
@@ -440,6 +440,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
440 | if (this.currentLayerNumber === undefined) { | 440 | if (this.currentLayerNumber === undefined) { |
441 | this.currentLayerNumber = 0; | 441 | this.currentLayerNumber = 0; |
442 | } | 442 | } |
443 | |||
443 | this.currentLayerNumber = this.currentLayerNumber + 1; | 444 | this.currentLayerNumber = this.currentLayerNumber + 1; |
444 | newLayerName = "Layer " + this.currentLayerNumber; | 445 | newLayerName = "Layer " + this.currentLayerNumber; |
445 | thingToPush.layerName = newLayerName; | 446 | thingToPush.layerName = newLayerName; |
@@ -449,14 +450,22 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
449 | thingToPush.isTransformCollapsed = true; | 450 | thingToPush.isTransformCollapsed = true; |
450 | thingToPush.isStyleCollapsed = true; | 451 | thingToPush.isStyleCollapsed = true; |
451 | thingToPush.arrLayerStyles = []; | 452 | thingToPush.arrLayerStyles = []; |
452 | thingToPush.element = []; | 453 | thingToPush.elementsList = []; |
453 | thingToPush.deleted = false; | 454 | thingToPush.deleted = false; |
454 | thingToPush.isSelected = false; | 455 | thingToPush.isSelected = false; |
455 | if (_firstLayerDraw) { | 456 | if (_firstLayerDraw) { |
456 | thingToPush.parentElementUUID = this.application.ninja.currentSelectedContainer.uuid; | 457 | |
458 | this.application.ninja.currentSelectedContainer.uuid=this._hashKey; | ||
459 | thingToPush.parentElementUUID = this._hashKey; | ||
457 | thingToPush.parentElement = this.application.ninja.currentSelectedContainer; | 460 | thingToPush.parentElement = this.application.ninja.currentSelectedContainer; |
458 | } | 461 | } |
459 | 462 | ||
463 | if(this._openDoc){ | ||
464 | event.detail.ele.uuid =nj.generateRandom(); | ||
465 | thingToPush.elementsList.push(event.detail.ele); | ||
466 | this._openDoc=false; | ||
467 | } | ||
468 | |||
460 | newTrack.trackID = this.currentLayerNumber; | 469 | newTrack.trackID = this.currentLayerNumber; |
461 | newTrack.isMainCollapsed = true; | 470 | newTrack.isMainCollapsed = true; |
462 | newTrack.isPositionCollapsed = true; | 471 | newTrack.isPositionCollapsed = true; |
@@ -471,6 +480,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
471 | if (_firstLayerDraw) { | 480 | if (_firstLayerDraw) { |
472 | if (this.application.ninja.currentSelectedContainer.id === "UserContent") { | 481 | if (this.application.ninja.currentSelectedContainer.id === "UserContent") { |
473 | this._hashKey = "123"; | 482 | this._hashKey = "123"; |
483 | this.application.ninja.currentSelectedContainer.uuid=this._hashKey; | ||
474 | thingToPush.parentElementUUID = 123; | 484 | thingToPush.parentElementUUID = 123; |
475 | } | 485 | } |
476 | } | 486 | } |
@@ -483,7 +493,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
483 | this.arrTracks.splice(myIndex, 0, newTrack); | 493 | this.arrTracks.splice(myIndex, 0, newTrack); |
484 | this.arrLayers.splice(myIndex, 0, thingToPush); | 494 | this.arrLayers.splice(myIndex, 0, thingToPush); |
485 | this._LayerUndoPosition = myIndex; | 495 | this._LayerUndoPosition = myIndex; |
486 | this.selectLayer(myIndex); | 496 | // this.selectLayer(myIndex); |
487 | this.hashLayerNumber.setItem(this._hashKey, thingToPush); | 497 | this.hashLayerNumber.setItem(this._hashKey, thingToPush); |
488 | this.hashInstance.setItem(this._hashKey, thingToPush, myIndex); | 498 | this.hashInstance.setItem(this._hashKey, thingToPush, myIndex); |
489 | this.hashTrackInstance.setItem(this._hashKey, newTrack, myIndex); | 499 | this.hashTrackInstance.setItem(this._hashKey, newTrack, myIndex); |
@@ -496,6 +506,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
496 | this.hashLayerNumber.setItem(this._hashKey, thingToPush); | 506 | this.hashLayerNumber.setItem(this._hashKey, thingToPush); |
497 | this.hashInstance.setItem(this._hashKey, thingToPush, thingToPush.layerPosition); | 507 | this.hashInstance.setItem(this._hashKey, thingToPush, thingToPush.layerPosition); |
498 | this.hashTrackInstance.setItem(this._hashKey, newTrack, newTrack.trackPosition); | 508 | this.hashTrackInstance.setItem(this._hashKey, newTrack, newTrack.trackPosition); |
509 | // this.selectLayer(0); | ||
499 | 510 | ||
500 | } | 511 | } |
501 | this._LayerUndoObject = thingToPush; | 512 | this._LayerUndoObject = thingToPush; |
@@ -515,11 +526,6 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
515 | var dLayer, dTrack, parentNode, hashVariable = 0, k = 0, index = 0, j = 0; | 526 | var dLayer, dTrack, parentNode, hashVariable = 0, k = 0, index = 0, j = 0; |
516 | 527 | ||
517 | if (this.arrLayers.length > 0) { | 528 | if (this.arrLayers.length > 0) { |
518 | if (this.arrLayers.length === 1) { | ||
519 | this._arrLayersNonEmpty = false; | ||
520 | alert("cannot delete further"); | ||
521 | return; | ||
522 | } | ||
523 | if (event.detail._undoStatus) { | 529 | if (event.detail._undoStatus) { |
524 | if (this.application.ninja.currentSelectedContainer.id === "UserContent" && event.detail._el.parentElementUUID === 123) { |