From 631c9750e5ad6d7739d8683c31aa3a9f8f3b4e4c Mon Sep 17 00:00:00 2001 From: Kruti Shah Date: Tue, 28 Feb 2012 15:01:41 -0800 Subject: Timeline: Fix Selection , Partially Fix adding element to an already animated track with one element Signed-off-by: Kruti Shah --- .../Timeline/TimelinePanel.reel/TimelinePanel.js | 27 ++++++++++++++++++---- .../Timeline/TimelineTrack.reel/TimelineTrack.js | 1 + 2 files changed, 23 insertions(+), 5 deletions(-) (limited to 'js/panels') diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index 01b03531..81415951 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js @@ -256,6 +256,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { while(this.application.ninja.currentDocument.documentRoot.children[myIndex]) { this._openDoc=true; + this._captureSelection=true; NJevent('newLayer',{key:this._hashKey,ele:this.application.ninja.currentDocument.documentRoot.children[myIndex]}) myIndex++; } @@ -579,7 +580,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); @@ -592,7 +593,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.selectLayer(0); } @@ -722,9 +723,21 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { handleElementAdded:{ value:function (event) { + event.detail.uuid=nj.generateRandom(); - this.hashElementMapToLayer.setItem(event.detail.uuid, event.detail,this.currentLayerSelected); - this.currentLayerSelected.elementsList.push(event.detail); + if(this.currentLayerSelected.elementsList[0]!==undefined){ + if(this.currentTrackSelected.isTrackAnimated){ + this.application.ninja.stage.clearDrawingCanvas(); + alert("cannot add elements to a layer with animated element");/* check how to clear the canvas*/ + return; + }else{ + this.hashElementMapToLayer.setItem(event.detail.uuid, event.detail,this.currentLayerSelected); + this.currentLayerSelected.elementsList.push(event.detail); + } + }else{ + this.hashElementMapToLayer.setItem(event.detail.uuid, event.detail,this.currentLayerSelected); + this.currentLayerSelected.elementsList.push(event.detail); + } } }, @@ -948,7 +961,11 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { this.currentTrackSelected = this.arrTracks[layerIndex]; if(!this._openDoc){ if(this._captureSelection){ - this.application.ninja.selectionController.selectElements(this.currentLayerSelected.elementsList) + if(this.currentLayerSelected.elementsList.length >= 1){ + this.application.ninja.selectionController.selectElements(this.currentLayerSelected.elementsList); + }else{ + this.application.ninja.selectionController.executeSelectElement(); + } } this._captureSelection = true; } diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js index 43cd7477..bf97c0fd 100644 --- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js +++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js @@ -519,6 +519,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { i++; this.nextKeyframe += 1; } + this.isTrackAnimated = true; } } else{ -- cgit v1.2.3 From 31dc61a626ee9f2b08cb098a51ca0fed5bf30e77 Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Wed, 29 Feb 2012 11:21:22 -0800 Subject: Squashed commit of the following: commit 3dbe798285f95dc63ae33739df5daadb8c432f24 Author: Valerio Virgillito Date: Tue Feb 28 16:20:25 2012 -0800 putting the color panel on top when opening ninja Signed-off-by: Valerio Virgillito commit b5ae7f0babb185051242df47634e24ad7a68f60e Merge: 20d4f1d 2bc8343 Author: Valerio Virgillito Date: Tue Feb 28 16:15:44 2012 -0800 Merge branch 'nested-selection' of https://github.com/mencio/ninja-internal into integration-candidate Conflicts: js/ninja.reel/ninja.html Signed-off-by: Valerio Virgillito commit 2bc834334a3197ab7cffacc7332eafd1b52443d1 Author: Valerio Virgillito Date: Tue Feb 28 16:11:42 2012 -0800 revert changes to the timeline Signed-off-by: Valerio Virgillito commit ae96ea66acc4be873fb7fb73fb3f4484b6db3eb8 Author: Valerio Virgillito Date: Tue Feb 28 16:03:32 2012 -0800 adding some margin to the bread crumb buttons Signed-off-by: Valerio Virgillito commit 20d4f1d703c004dd7f869576b6c471b3fb5b5d3e Merge: ee52f19 557c4d3 Author: Valerio Virgillito Date: Tue Feb 28 16:02:37 2012 -0800 Merge pull request #81 from ananyasen/integration-candidate persist selections while switching documents commit 557c4d3100ccde51b925b71f0650b2c783a4a042 Author: Ananya Sen Date: Tue Feb 28 16:02:15 2012 -0800 minor fix for handling selections on switch document Signed-off-by: Ananya Sen commit a230f0cd065613a1bc933e3d6d3f7e77f52bec04 Author: Ananya Sen Date: Tue Feb 28 15:48:55 2012 -0800 selection controller sets _isDocument = true if number of selections are 0, on switch document Signed-off-by: Ananya Sen commit ee52f197d1eb53a5ff30b54b8df1d2b53014eb0e Merge: 8e370cc da83f44 Author: Valerio Virgillito Date: Tue Feb 28 15:16:12 2012 -0800 Merge pull request #80 from joseeight/FileIO-Build-Candidate Adding CSS attributes support to I/O commit 5ab7efb9949e486395659c383064a08821febdae Author: Ananya Sen Date: Tue Feb 28 15:15:27 2012 -0800 persist selections while switching documents Signed-off-by: Ananya Sen commit da83f44b0ecf379b0950a88d1c378fbedb80e386 Merge: b799b7c 676b4e2 Author: Jose Antonio Marquez Date: Tue Feb 28 15:15:12 2012 -0800 Merge branch 'refs/heads/integration-candidate' into FileIO-Build-Candidate commit 8e370cc72aa85de594a5d55ae89947a70af414ca Merge: 8de4002 676b4e2 Author: Valerio Virgillito Date: Tue Feb 28 15:08:48 2012 -0800 Merge branch 'integration-candidate' of github.com:Motorola-Mobility/ninja-internal into integration-candidate commit 8de40029442333114d81ac30a8886a995a3dc56b Merge: b0b4d64 eb27ed3 Author: Valerio Virgillito Date: Tue Feb 28 15:08:18 2012 -0800 Merge branch 'ToolFixes' of https://github.com/mqg734/ninja-internal into integration-candidate commit eb27ed35bf282262843de13b00af89a2bceac53f Merge: ea59626 7c9291a Author: Nivesh Rajbhandari Date: Tue Feb 28 15:04:33 2012 -0800 Merge branch 'refs/heads/ninja-internal' into ToolFixes commit b799b7cf3a422f407045c52a4c6a61756d1ea096 Merge: f7c08fe 2ce9f65 Author: Jose Antonio Marquez Date: Tue Feb 28 15:03:38 2012 -0800 Merge branch 'refs/heads/FileIO' into FileIO-Build-Candidate commit 2ce9f65c3a34937928f08690606962af3085c74f Author: Jose Antonio Marquez Date: Tue Feb 28 15:03:23 2012 -0800 CSS attributes Setting up logic to include attributes in for the