From b7402018659cf8058d5646c08b2a916492269e33 Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Thu, 23 Feb 2012 07:37:17 -0800 Subject: Timeline Reset to clean Master branch. Code scrub. Fresh copy of ninja-internal/master with Timeline folder copied in to resolved merge issues. Signed-off-by: Jonathan Duran --- .../Timeline/TimelinePanel.reel/TimelinePanel.js | 102 ++++++++++++++------- 1 file changed, 71 insertions(+), 31 deletions(-) mode change 100755 => 100644 js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js (limited to 'js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js') diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js old mode 100755 new mode 100644 index 07fee19d..43e758f4 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js @@ -65,6 +65,22 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { value:1000 }, + _masterDuration:{ + serializable: true, + value:0 + }, + + masterDuration:{ + serializable:true, + get:function(){ + return this._masterDuration; + }, + set:function(val){ + this._masterDuration = val; + this.timebar.style.width = (this._masterDuration / 12) + "px"; + } + }, + _arrTracks:{ serializable:true, value:[] @@ -109,6 +125,20 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { } }, + _selectedTweens:{ + value:[] + }, + + selectedTweens:{ + serializable:true, + get:function () { + return this._selectedTweens; + }, + set:function (newVal) { + this._selectedTweens = newVal; + } + }, + _isLayer:{ value:false }, @@ -234,13 +264,13 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { } }, - deselectKeyframes:{ + deselectTweens:{ value:function () { - for (var i = 0; i < this.selectedKeyframes.length; i++) { - this.selectedKeyframes[i].deselect(); + for (var i = 0; i < this.selectedTweens.length; i++) { + this.selectedTweens[i].deselectTween(); } - this.selectedKeyframes = null; - this.selectedKeyframes = new Array(); + this.selectedTweens = null; + this.selectedTweens = new Array(); } }, @@ -253,6 +283,14 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { handleDeleteLayerClick:{ value:function (event) { + if (this.arrLayers.length === 1) { + // do not delete last layer + return; + } + if (this.layerRepetition.selectedIndexes === null) { + // nothing is selected, do not delete + return; + } this._deleteKeyDown = false; if (this.application.ninja.currentSelectedContainer.id === "UserContent") { this._hashKey = "123"; @@ -269,10 +307,9 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { if (this._firstTimeLoaded) { this._firstTimeLoaded = false; } else { - while (this.arrLayers.pop()) { - } - while (this.arrTracks.pop()) { - } + this.arrLayers.length = 0; + this.arrTracks.length = 0; + if (event.detail.element.id === "UserContent") { this._hashKey = "123"; } else { @@ -308,8 +345,9 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { while (layerResult = this.returnedObject[hashIndex]) { trackResult = this.returnedTrack[hashIndex]; if (layerResult.deleted !== true) { - this.arrLayers.push(layerResult); this.arrTracks.push(trackResult); + this.arrLayers.push(layerResult); + } hashIndex++; } @@ -322,8 +360,9 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { while (dLayer[hashVariable]) { if (dLayer[hashVariable]._layerID === event.detail._el._layerID) { dLayer[hashVariable].deleted = false; - this.arrLayers.splice(event.detail._layerPosition, 1, event.detail._el); - this.arrTracks.splice(event.detail._layerPosition, 1, event.detail._track); + this.arrTracks.splice(event.detail._layerPosition, 0, event.detail._track); + this.arrLayers.splice(event.detail._layerPosition, 0, event.detail._el); + break; } @@ -349,8 +388,8 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { while (dLayer[hashVariable]) { if (dLayer[hashVariable]._layerID === event.detail._el._layerID) { dLayer[hashVariable].deleted = false; - this.arrLayers.splice(event.detail._layerPosition, 1, event.detail._el); - this.arrTracks.splice(event.detail._layerPosition, 1, event.detail._track); + this.arrTracks.splice(event.detail._layerPosition, 0, event.detail._track); + this.arrLayers.splice(event.detail._layerPosition, 0, event.detail._el); break; } @@ -387,12 +426,15 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { thingToPush.parentElement = this.application.ninja.currentSelectedContainer; } - newTrack.trackID = this.currentLayerNumber; newTrack.isMainCollapsed = true; newTrack.isPositionCollapsed = true; newTrack.isTransformCollapsed = true; - newTrack.isStyleCollapsed = false; + newTrack.isStyleCollapsed = true; + newTrack.isTrackAnimated = false; + newTrack.currentKeyframeRule = null; + newTrack.trackPosition = 0; + newTrack.arrStyleTracks = []; newTrack.tweens = []; if (_firstLayerDraw) { @@ -407,16 +449,16 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { thingToPush.layerPosition = myIndex; thingToPush.isSelected = true; newTrack.trackPosition = myIndex; - this.arrLayers.splice(myIndex, 0, thingToPush); this.arrTracks.splice(myIndex, 0, newTrack); + this.arrLayers.splice(myIndex, 0, thingToPush); this._LayerUndoPosition = myIndex; this.selectLayer(myIndex); this.hashLayerNumber.setItem(this._hashKey, thingToPush); this.hashInstance.setItem(this._hashKey, thingToPush, myIndex); this.hashTrackInstance.setItem(this._hashKey, newTrack, myIndex); } else { - this.arrLayers.splice(0, 0, thingToPush); this.arrTracks.splice(0, 0, newTrack); + this.arrLayers.splice(0, 0, thingToPush); thingToPush.layerPosition = this.arrLayers.length - 1; newTrack.trackPosition = this.arrTracks.length - 1; this._LayerUndoPosition = this.arrLayers.length - 1; @@ -429,13 +471,9 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { this._LayerUndoIndex = thingToPush.layerID; this._LayerUndoStatus = true; this._TrackUndoObject = newTrack; - - // Removing clearing the selection - Handled by the selection-controller - /* if(_firstLayerDraw){ - this.application.ninja.selectionController.executeSelectElement(); + this.application.ninja.selectionController.executeSelectElement(); } - */ } } @@ -461,7 +499,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { while (this.arrLayers.length) { if (dLayer[hashVariable]._layerID === this.arrLayers[k]._layerID) { dLayer[hashVariable].deleted = true; - ElementMediator.deleteElements(dLayer[myIndex].element); +// ElementMediator.deleteElements(dLayer[myIndex].element); this.arrLayers.splice(k, 1); this.arrTracks.splice(k, 1); break; @@ -477,7 +515,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { while (dLayer[hashVariable]) { if (dLayer[hashVariable]._layerID === event.detail._el._layerID) { dLayer[hashVariable].deleted = true; - ElementMediator.deleteElements(dLayer[myIndex].element); +// ElementMediator.deleteElements(dLayer[myIndex].element); parentNode = dLayer[hashVariable].parentElement; break; } @@ -495,7 +533,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { while (this.arrLayers.length) { if (dLayer[hashVariable]._layerID === this.arrLayers[k]._layerID) { dLayer[hashVariable].deleted = true; - ElementMediator.deleteElements(dLayer[myIndex].element); +// ElementMediator.deleteElements(dLayer[myIndex].element); this.arrLayers.splice(k, 1); this.arrTracks.splice(k, 1); break; @@ -516,12 +554,13 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { dLayer = this.hashInstance.getItem(this._hashKey); dTrack = this.hashTrackInstance.getItem(this._hashKey); dLayer[myIndex].deleted = true; - ElementMediator.deleteElements(dLayer[myIndex].element); this.arrLayers.splice(myIndex, 1); this.arrTracks.splice(myIndex, 1); this._LayerUndoIndex = this._LayerUndoObject.layerID; this._LayerUndoPosition = myIndex; + ElementMediator.deleteElements(dLayer[myIndex].element); + } else { dLayer = this.hashInstance.getItem(this._hashKey); dTrack = this.hashTrackInstance.getItem(this._hashKey); @@ -744,6 +783,10 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { var i = 0, arrLayersLength = this.arrLayers.length; + if(this.selectedKeyframes){ + this.deselectTweens(); + } + for (i = 0; i < arrLayersLength; i++) { if (i === layerIndex) { this.arrLayers[i].isSelected = true; @@ -757,12 +800,9 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { this.trackRepetition.selectedIndexes = [layerIndex]; this.currentLayerSelected = this.arrLayers[layerIndex]; this.currentTrackSelected = this.arrTracks[layerIndex]; - // Selection is being handled by the selection controller - /* if(this._captureSelection){ - this.application.ninja.selectionController.selectElements(this.currentLayerSelected.element) + this.application.ninja.selectionController.selectElements(this.currentLayerSelected.element) } - */ this._captureSelection = true; } else { this.layerRepetition.selectedIndexes = null; -- cgit v1.2.3 From 4d1f1d02e9e443485357c482432938fd0d9f757d Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Thu, 23 Feb 2012 07:57:17 -0800 Subject: Redo timeline resize code Signed-off-by: Jonathan Duran --- js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js') diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index 43e758f4..8764d041 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js @@ -157,6 +157,9 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { value:false, writable:true }, + timeMarkerHolder:{ + value: null + }, /* === END: Models === */ /* === BEGIN: Draw cycle === */ @@ -202,6 +205,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { this.timeline_leftpane.addEventListener("click", this.timelineLeftPaneClick.bind(this), false); this.layout_tracks.addEventListener("scroll", this.updateLayerScroll.bind(this), false); this.user_layers.addEventListener("scroll", this.updateLayerScroll.bind(this), false); + this.end_hottext.addEventListener("changing", this.updateTrackContainerWidth.bind(this), false); this.drawTimeMarkers(); @@ -213,6 +217,16 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { } }, + updateTrackContainerWidth:{ + value: function(){ + this.container_tracks.style.width = (this.end_hottext.value * 80) + "px"; + this.master_track.style.width = (this.end_hottext.value * 80) + "px"; + this.time_markers.style.width = (this.end_hottext.value * 80) + "px"; + this.time_markers.removeChild(this.timeMarkerHolder); + this.drawTimeMarkers(); + } + }, + updateLayerScroll:{ value:function () { this.user_layers.scrollTop = this.layout_tracks.scrollTop; @@ -602,6 +616,8 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { drawTimeMarkers:{ value:function () { + this.timeMarkerHolder = document.createElement("div"); + this.time_markers.appendChild(this.timeMarkerHolder); var i; var totalMarkers = Math.floor(this.time_markers.offsetWidth / 80); for (i = 0; i < totalMarkers; i++) { @@ -609,7 +625,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { var markValue = this.calculateTimeMarkerValue(i); timeMark.className = "timemark"; timeMark.innerHTML = markValue; - this.time_markers.appendChild(timeMark); + this.timeMarkerHolder.appendChild(timeMark); } } }, -- cgit v1.2.3 From a712e134ea94b6a21061c1bd272ce15b1f95b986 Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Thu, 23 Feb 2012 08:04:35 -0800 Subject: Unterminated lines Signed-off-by: Jonathan Duran --- js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js') diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index 8764d041..05fdccb2 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js @@ -241,7 +241,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { key = this.application.ninja.selectedElements[0].uuid; switchSelectedLayer = this.hashElementMapToLayer.getItem(key); if(switchSelectedLayer!==undefined){ - layerIndex = this.getLayerIndexByID(switchSelectedLayer.layerID) + layerIndex = this.getLayerIndexByID(switchSelectedLayer.layerID); this._captureSelection=false; this.selectLayer(layerIndex); this._captureSelection=true; @@ -767,7 +767,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { createElementMapToLayer:{ value:function(){ - var hashMappingObject + var hashMappingObject; hashMappingObject = Object.create(Object.prototype, { mappingArray:{ value:{}, -- cgit v1.2.3 From 7b6f27edb718d381ccec6089a8039ffa0dcb80a2 Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Thu, 23 Feb 2012 11:04:51 -0800 Subject: Timeline:Open Doc in TimelinePanel.js Signed-off-by: Kruti Shah Signed-off-by: Jonathan Duran --- js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js') diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index 05fdccb2..1d9419c6 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js @@ -164,8 +164,13 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { /* === BEGIN: Draw cycle === */ prepareForDraw:{ - value:function () { + value:function () { + this.eventManager.addEventListener( "onOpenDocument", this, false); + } + }, + handleOnOpenDocument:{ + value:function(){ this.eventManager.addEventListener("deleteLayerClick", this, false); this.eventManager.addEventListener("newLayer", this, false); this.eventManager.addEventListener("deleteLayer", this, false); @@ -179,9 +184,10 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { this.hashLayerNumber = this.createLayerNumberHash(); this.hashElementMapToLayer = this.createElementMapToLayer(); this.initTimelineView(); + + } }, - willDraw:{ value:function () { if (this._isLayer) { -- cgit v1.2.3 From 80e4203dd97866da3cf03b28b1b65c8153274e18 Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Thu, 23 Feb 2012 11:06:10 -0800 Subject: New Doc Signed-off-by: Kruti Shah Signed-off-by: Jonathan Duran --- js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js') diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index 1d9419c6..8eb2b745 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js @@ -201,6 +201,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { /* === BEGIN: Controllers === */ initTimelineView:{ value:function () { + var myIndex; this.layout_tracks = this.element.querySelector(".layout-tracks"); this.layout_markers = this.element.querySelector(".layout_markers"); @@ -217,7 +218,17 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { this._hashKey = "123"; _firstLayerDraw = false; - NJevent('newLayer', this._hashKey); + if(this.application.ninja.currentDocument.documentRoot.children[0]){ + myIndex=0; + while(this.application.ninja.currentDocument.documentRoot.children[myIndex]) + { + this.application.ninja.currentDocument.documentRoot.children[myIndex]; + NJevent('newLayer',{key:this._hashKey,element:this.application.ninja.currentDocument.documentRoot.children[myIndex]}); + myIndex++; + } + }else{ + NJevent('newLayer', this._hashKey); + } _firstLayerDraw = true; this.selectLayer(0); } -- cgit v1.2.3 From 7de846bfe60bde190c14053107fcb227f6404d65 Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Thu, 23 Feb 2012 11:17:22 -0800 Subject: Timeline: Reopen Doc Restore TimeLine Signed-off-by: Kruti Shah Conflicts: js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js Signed-off-by: Jonathan Duran --- .../Timeline/TimelinePanel.reel/TimelinePanel.js | 89 ++++++++++++---------- 1 file changed, 48 insertions(+), 41 deletions(-) (limited to 'js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js') 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, { writable:true }, - _arrLayersNonEmpty:{ - value:true, + _captureSelection:{ + value:false, writable:true }, - _captureSelection:{ + _openDoc:{ value:false, writable:true }, @@ -222,15 +222,18 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { myIndex=0; while(this.application.ninja.currentDocument.documentRoot.children[myIndex]) { - this.application.ninja.currentDocument.documentRoot.children[myIndex]; - NJevent('newLayer',{key:this._hashKey,element:this.application.ninja.currentDocument.documentRoot.children[myIndex]}); + this._openDoc=true; + NJevent('newLayer',{key:this._hashKey,ele:this.application.ninja.currentDocument.documentRoot.children[myIndex]}) +// this.selectLayer(myIndex); +// TimelineTrack.retrieveStoredTweens(); myIndex++; } }else{ NJevent('newLayer', this._hashKey); + this.selectLayer(0); + } _firstLayerDraw = true; - this.selectLayer(0); } }, @@ -314,14 +317,14 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { handleDeleteLayerClick:{ value:function (event) { - if (this.arrLayers.length === 1) { - // do not delete last layer - return; - } - if (this.layerRepetition.selectedIndexes === null) { - // nothing is selected, do not delete - return; - } + if (this.arrLayers.length === 1) { + // do not delete last layer + return; + } + if (this.layerRepetition.selectedIndexes === null) { + // nothing is selected, do not delete + return; + } this._deleteKeyDown = false; if (this.application.ninja.currentSelectedContainer.id === "UserContent") { this._hashKey = "123"; @@ -333,7 +336,6 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { handleLayerBinding:{ value:function (event) { var i = 0; - this.currentParentNode = this.application.ninja.currentSelectedContainer.parentNode; if (this._firstTimeLoaded) { this._firstTimeLoaded = false; @@ -371,7 +373,6 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { value:function (event) { var hashIndex = 0 , hashVariable = 0, layerResult, trackResult, layerObject, trackObject, dLayer, parentNode; - this._arrLayersNonEmpty = true; if (this._hashFind) { while (layerResult = this.returnedObject[hashIndex]) { trackResult = this.returnedTrack[hashIndex]; @@ -393,7 +394,6 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { dLayer[hashVariable].deleted = false; this.arrTracks.splice(event.detail._layerPosition, 0, event.detail._track); this.arrLayers.splice(event.detail._layerPosition, 0, event.detail._el); - break; } @@ -412,8 +412,8 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { } hashVariable++; } - this._setBreadCrumb = true; - NJevent('breadCrumbTrail', {"element":parentNode, "setFlag":this._setBreadCrumb}); + this.application.ninja.currentSelectedContainer = parentNode; + //NJevent('breadCrumbTrail', {"element":parentNode, "setFlag":this._setBreadCrumb}); } else { dLayer = this.hashInstance.getItem(event.detail._el.parentElementUUID); while (dLayer[hashVariable]) { @@ -440,6 +440,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { if (this.currentLayerNumber === undefined) { this.currentLayerNumber = 0; } + this.currentLayerNumber = this.currentLayerNumber + 1; newLayerName = "Layer " + this.currentLayerNumber; thingToPush.layerName = newLayerName; @@ -449,14 +450,22 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { thingToPush.isTransformCollapsed = true; thingToPush.isStyleCollapsed = true; thingToPush.arrLayerStyles = []; - thingToPush.element = []; + thingToPush.elementsList = []; thingToPush.deleted = false; thingToPush.isSelected = false; if (_firstLayerDraw) { - thingToPush.parentElementUUID = this.application.ninja.currentSelectedContainer.uuid; + + this.application.ninja.currentSelectedContainer.uuid=this._hashKey; + thingToPush.parentElementUUID = this._hashKey; thingToPush.parentElement = this.application.ninja.currentSelectedContainer; } + if(this._openDoc){ + event.detail.ele.uuid =nj.generateRandom(); + thingToPush.elementsList.push(event.detail.ele); + this._openDoc=false; + } + newTrack.trackID = this.currentLayerNumber; newTrack.isMainCollapsed = true; newTrack.isPositionCollapsed = true; @@ -471,6 +480,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { if (_firstLayerDraw) { if (this.application.ninja.currentSelectedContainer.id === "UserContent") { this._hashKey = "123"; + this.application.ninja.currentSelectedContainer.uuid=this._hashKey; thingToPush.parentElementUUID = 123; } } @@ -483,7 +493,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { this.arrTracks.splice(myIndex, 0, newTrack); this.arrLayers.splice(myIndex, 0, thingToPush); this._LayerUndoPosition = myIndex; - this.selectLayer(myIndex); +// this.selectLayer(myIndex); this.hashLayerNumber.setItem(this._hashKey, thingToPush); this.hashInstance.setItem(this._hashKey, thingToPush, myIndex); this.hashTrackInstance.setItem(this._hashKey, newTrack, myIndex); @@ -496,6 +506,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { this.hashLayerNumber.setItem(this._hashKey, thingToPush); this.hashInstance.setItem(this._hashKey, thingToPush, thingToPush.layerPosition); this.hashTrackInstance.setItem(this._hashKey, newTrack, newTrack.trackPosition); +// this.selectLayer(0); } this._LayerUndoObject = thingToPush; @@ -515,11 +526,6 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { var dLayer, dTrack, parentNode, hashVariable = 0, k = 0, index = 0, j = 0; if (this.arrLayers.length > 0) { - if (this.arrLayers.length === 1) { - this._arrLayersNonEmpty = false; - alert("cannot delete further"); - return; - } if (event.detail._undoStatus) { if (this.application.ninja.currentSelectedContainer.id === "UserContent" && event.detail._el.parentElementUUID === 123) { dLayer = this.hashInstance.getItem(event.detail._el.parentElementUUID); @@ -552,8 +558,8 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { } hashVariable++; } - this._setBreadCrumb = true; - NJevent('breadCrumbTrail', {"element":parentNode, "setFlag":this._setBreadCrumb}); + this.application.ninja.currentSelectedContainer = parentNode; + // NJevent('breadCrumbTrail', {"element":parentNode, "setFlag":this._setBreadCrumb}); } else { dLayer = this.hashInstance.getItem(event.detail._el.parentElementUUID); @@ -590,13 +596,13 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { this.arrTracks.splice(myIndex, 1); this._LayerUndoIndex = this._LayerUndoObject.layerID; this._LayerUndoPosition = myIndex; - ElementMediator.deleteElements(dLayer[myIndex].element); + ElementMediator.deleteElements(dLayer[myIndex].ele); } else { dLayer = this.hashInstance.getItem(this._hashKey); dTrack = this.hashTrackInstance.getItem(this._hashKey); dLayer[this.arrLayers.length - 1].deleted = true; - ElementMediator.deleteElements(dLayer[this.arrLayers.length - 1].element); + ElementMediator.deleteElements(dLayer[this.arrLayers.length - 1].ele); this._LayerUndoPosition = this.arrLayers.length - 1; this._LayerUndoObject = this.arrLayers.pop(); this._LayerUndoIndex = this._LayerUndoObject.layerID; @@ -610,8 +616,9 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { handleElementAdded:{ value:function (event) { - this.hashElementMapToLayer.setItem(event.detail.uuid , event.detail,this.currentLayerSelected) - this.currentLayerSelected.element.push(event.detail); + event.detail.uuid=nj.generateRandom(); + this.hashElementMapToLayer.setItem(event.detail.uuid, event.detail,this.currentLayerSelected); + this.currentLayerSelected.elementsList.push(event.detail); } }, @@ -620,10 +627,10 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { value:function (event) { var length; this.deleteElement = event.detail; - length = this.currentLayerSelected.element.length - 1; + length = this.currentLayerSelected.elementsList.length - 1; while (length >= 0) { - if (this.currentLayerSelected.element[length] === this.deleteElement) { - this.currentLayerSelected.element.splice(length, 1); + if (this.currentLayerSelected.elementsList[length] === this.deleteElement) { + this.currentLayerSelected.elementsList.splice(length, 1); break; } length--; @@ -795,7 +802,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { if(this.mappingArray[key]===undefined){ this.mappingArray[key]={}; } - this.mappingArray[key]["element"] = value; + this.mappingArray[key]["ele"] = value; this.mappingArray[key].layerID = layer.layerID; } @@ -834,7 +841,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { this.currentLayerSelected = this.arrLayers[layerIndex]; this.currentTrackSelected = this.arrTracks[layerIndex]; if(this._captureSelection){ - this.application.ninja.selectionController.selectElements(this.currentLayerSelected.element) + this.application.ninja.selectionController.selectElements(this.currentLayerSelected.elementsList) } this._captureSelection = true; } else { @@ -913,9 +920,8 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { cmd._layerPosition = this._LayerUndoPosition; cmd._undoStatus = this._LayerUndoStatus; cmd._track = this._TrackUndoObject; - if (this._arrLayersNonEmpty) { - NJevent("sendToUndo", cmd); - } + NJevent("sendToUndo", cmd); + } }, @@ -970,3 +976,4 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { } /* === END: Controllers === */ }); + -- cgit v1.2.3 From a8c153cc4f6a4f4f3367b0b2a763fa86b442c201 Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Thu, 23 Feb 2012 13:39:51 -0800 Subject: Remove selection calls from timelinepanel.js Signed-off-by: Jonathan Duran --- js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js') diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index 1a0b9e80..62ae625f 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js @@ -513,9 +513,9 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { this._LayerUndoIndex = thingToPush.layerID; this._LayerUndoStatus = true; this._TrackUndoObject = newTrack; - if(_firstLayerDraw){ - this.application.ninja.selectionController.executeSelectElement(); - } +// if(_firstLayerDraw){ +// this.application.ninja.selectionController.executeSelectElement(); +// } } } @@ -840,9 +840,9 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { this.trackRepetition.selectedIndexes = [layerIndex]; this.currentLayerSelected = this.arrLayers[layerIndex]; this.currentTrackSelected = this.arrTracks[layerIndex]; - if(this._captureSelection){ + /*if(this._captureSelection){ this.application.ninja.selectionController.selectElements(this.currentLayerSelected.elementsList) - } + }*/ this._captureSelection = true; } else { this.layerRepetition.selectedIndexes = null; -- cgit v1.2.3