diff options
author | Jose Antonio Marquez | 2012-05-23 13:37:15 -0700 |
---|---|---|
committer | Jose Antonio Marquez | 2012-05-23 13:37:15 -0700 |
commit | 16decc5726eafbb25675c61be6df85a378ac1fac (patch) | |
tree | 5590c4a20a5d9297d3e66a1d290db32f028047eb /js/controllers/document-controller.js | |
parent | 27e6e1238ec1adb34aa396074e2559801c7e4314 (diff) | |
parent | 108764dbdaa0c040de9146c2d722b6e53830cd54 (diff) | |
download | ninja-16decc5726eafbb25675c61be6df85a378ac1fac.tar.gz |
Merge branch 'refs/heads/Ninja-DOM-Architecture' into Document
Diffstat (limited to 'js/controllers/document-controller.js')
-rwxr-xr-x | js/controllers/document-controller.js | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js index 9ca5ea99..4edcff48 100755 --- a/js/controllers/document-controller.js +++ b/js/controllers/document-controller.js | |||
@@ -394,14 +394,20 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
394 | 394 | ||
395 | onCloseFile: { | 395 | onCloseFile: { |
396 | value: function(doc) { | 396 | value: function(doc) { |
397 | var previousFocusedDocument; | ||
397 | 398 | ||
398 | this._documents.splice(this._documents.indexOf(doc), 1); | 399 | this._documents.splice(this._documents.indexOf(doc), 1); |
399 | 400 | ||
400 | this._activeDocument = null; | 401 | if(this._documents.length > 0) { |
401 | 402 | previousFocusedDocument = this._documents[this._documents.length - 1]; | |
402 | this.application.ninja.stage.hideRulers(); | 403 | this._activeDocument = previousFocusedDocument; |
404 | this.switchDocuments(this.activeDocument, previousFocusedDocument, true); | ||
405 | } else { | ||
406 | this._activeDocument = null; | ||
407 | this.application.ninja.stage.hideRulers(); | ||
403 | 408 | ||
404 | this.application.ninja.stage.hideCanvas(true); | 409 | this.application.ninja.stage.hideCanvas(true); |
410 | } | ||
405 | 411 | ||
406 | //TODO: Use references for those instead of calling getElementById | 412 | //TODO: Use references for those instead of calling getElementById |
407 | if(this._documents.length === 0){ | 413 | if(this._documents.length === 0){ |