aboutsummaryrefslogtreecommitdiff
path: root/js/controllers/document-controller.js
diff options
context:
space:
mode:
authorAnanya Sen2012-03-06 16:30:33 -0800
committerAnanya Sen2012-03-06 16:30:33 -0800
commit2364c671ffc2953e3ee8dfdf037244de8fab3920 (patch)
treedfdcc7d60b5d8627d6b41d0b37e66ad5cc75ba5b /js/controllers/document-controller.js
parentfbde30a4651d34ac569bf6750db5dd017ccc8d6e (diff)
downloadninja-2364c671ffc2953e3ee8dfdf037244de8fab3920.tar.gz
IKNINJA-1238 fix and fixing other js errors on switching and closing documents
Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com>
Diffstat (limited to 'js/controllers/document-controller.js')
-rwxr-xr-xjs/controllers/document-controller.js21
1 files changed, 20 insertions, 1 deletions
diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js
index 194496a6..1f8c58b0 100755
--- a/js/controllers/document-controller.js
+++ b/js/controllers/document-controller.js
@@ -61,7 +61,7 @@ var DocumentController = exports.DocumentController = Montage.create(Component,
61 this.eventManager.addEventListener("executeSaveAs", this, false); 61 this.eventManager.addEventListener("executeSaveAs", this, false);
62 this.eventManager.addEventListener("executeSaveAll", this, false); 62 this.eventManager.addEventListener("executeSaveAll", this, false);
63 63
64 this.eventManager.addEventListener("recordStyleChanged", this, false); 64 this.eventManager.addEventListener("styleSheetDirty", this, false);
65 65
66 } 66 }
67 }, 67 },
@@ -168,6 +168,10 @@ var DocumentController = exports.DocumentController = Montage.create(Component,
168 value: function (result) { 168 value: function (result) {
169 if(result.status === 204){ 169 if(result.status === 204){
170 this.activeDocument.needsSave = false; 170 this.activeDocument.needsSave = false;
171 if(this.application.ninja.currentDocument !== null){
172 //clear Dirty StyleSheets for the saved document
173 this.application.ninja.stylesController.clearDirtyStyleSheets(this.application.ninja.currentDocument);
174 }
171 } 175 }
172 } 176 }
173 }, 177 },
@@ -249,6 +253,15 @@ var DocumentController = exports.DocumentController = Montage.create(Component,
249 }, 253 },
250 //////////////////////////////////////////////////////////////////// 254 ////////////////////////////////////////////////////////////////////
251 // 255 //
256 saveAsCallback:{
257 value:function(){
258 //close current document
259
260 //create a new file
261 }
262 },
263
264 ////////////////////////////////////////////////////////////////////
252 openDocument: { 265 openDocument: {
253 value: function(doc) { 266 value: function(doc) {
254 267
@@ -506,5 +519,11 @@ var DocumentController = exports.DocumentController = Montage.create(Component,
506 value: function() { 519 value: function() {
507 return "userDocument_" + (this._iframeCounter++); 520 return "userDocument_" + (this._iframeCounter++);
508 } 521 }
522 },
523
524 handleStyleSheetDirty:{
525 value:function(){
526 this.activeDocument.needsSave = true;
509 } 527 }
528 }
510}); 529});