aboutsummaryrefslogtreecommitdiff
path: root/js/ninja.reel/ninja.js
diff options
context:
space:
mode:
authorValerio Virgillito2012-06-01 11:15:26 -0700
committerValerio Virgillito2012-06-01 11:15:26 -0700
commit2085c783cf3a75d2b8f0370a6f54f62dd513161c (patch)
tree7774205bea2c125a40d8d9a80aa579656ef76a27 /js/ninja.reel/ninja.js
parent7fcb10270f9e19415f8452c261c2d0c86916a29a (diff)
downloadninja-2085c783cf3a75d2b8f0370a6f54f62dd513161c.tar.gz
fixing the document closing when the first document is closed.
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'js/ninja.reel/ninja.js')
-rwxr-xr-xjs/ninja.reel/ninja.js33
1 files changed, 8 insertions, 25 deletions
diff --git a/js/ninja.reel/ninja.js b/js/ninja.reel/ninja.js
index 9593973e..ac883923 100755
--- a/js/ninja.reel/ninja.js
+++ b/js/ninja.reel/ninja.js
@@ -26,12 +26,6 @@ exports.Ninja = Montage.create(Component, {
26 value: AppData 26 value: AppData
27 }, 27 },
28 28
29 /*
30 currentDocument: {
31 value: null
32 },
33 */
34
35 documentList: { 29 documentList: {
36 value: null 30 value: null
37 }, 31 },
@@ -46,9 +40,6 @@ exports.Ninja = Montage.create(Component, {
46 } 40 }
47 }, 41 },
48 42
49 _isResizing: {
50 value: null
51 },
52 _resizedHeight : { 43 _resizedHeight : {
53 value: 0 44 value: 0
54 }, 45 },
@@ -199,8 +190,6 @@ exports.Ninja = Montage.create(Component, {
199 this.addPropertyChangeListener("appModel.livePreview", this.executeLivePreview, false); 190 this.addPropertyChangeListener("appModel.livePreview", this.executeLivePreview, false);
200 this.addPropertyChangeListener("appModel.chromePreview", this.executeChromePreview, false); 191 this.addPropertyChangeListener("appModel.chromePreview", this.executeChromePreview, false);
201 this.addPropertyChangeListener("appModel.debug", this.toggleDebug, false); 192 this.addPropertyChangeListener("appModel.debug", this.toggleDebug, false);
202
203 NJevent("appLoading");
204 } 193 }
205 }, 194 },
206 195
@@ -312,16 +301,20 @@ exports.Ninja = Montage.create(Component, {
312 value: function(document) { 301 value: function(document) {
313 var doc = this.documentList.content[this.documentList.content.indexOf(document)], activeDocument; 302 var doc = this.documentList.content[this.documentList.content.indexOf(document)], activeDocument;
314 303
315 if(this.documentList.selectedObjects[0] === doc) { 304 if(this.documentList.selectedObjects[0] !== doc) {
316 activeDocument = this.documentList.content[0];
317 } else {
318 activeDocument = this.documentList.selectedObjects[0]; 305 activeDocument = this.documentList.selectedObjects[0];
306 } else {
307 activeDocument = null;
319 } 308 }
320 309
321 this.documentList.removeObjects(doc); 310 this.documentList.removeObjects(doc);
322 311
323 if(this.documentList.content.length) { 312 if(activeDocument) {
324 this.documentList.selectedObjects = [activeDocument]; 313 this.documentList.selectedObjects = [activeDocument];
314 } else {
315 if(this.documentList.content.length) {
316 this.documentList.selectedObjects = this.documentList.content[0];
317 }
325 } 318 }
326 } 319 }
327 }, 320 },
@@ -383,16 +376,6 @@ exports.Ninja = Montage.create(Component, {
383 } 376 }
384 }, 377 },
385 378
386 getCurrentToolInstance: {
387 value: function() {
388 if(this.toolsData.selectedTool.container) {
389 return this.toolsList[this.toolsData.selectedSubTool.action];
390 } else {
391 return this.toolsList[this.toolsData.selectedTool.action];
392 }
393 }
394 },
395
396 setupGlobalHelpers: { 379 setupGlobalHelpers: {
397 value: function() { 380 value: function() {
398 381