diff options
Diffstat (limited to 'js/controllers/document-controller.js')
-rwxr-xr-x | js/controllers/document-controller.js | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js index 7470bae2..48e33267 100755 --- a/js/controllers/document-controller.js +++ b/js/controllers/document-controller.js | |||
@@ -67,19 +67,19 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
67 | 67 | ||
68 | 68 | ||
69 | 69 | ||
70 | 70 | ||
71 | 71 | ||
72 | 72 | ||
73 | 73 | ||
74 | //////////////////////////////////////////////////////////////////// | 74 | //////////////////////////////////////////////////////////////////// |
75 | // | 75 | // |
76 | handleWebRequest: { | 76 | handleWebRequest: { |
77 | value: function (request) { | 77 | value: function (request) { |
78 | if (this._hackRootFlag && request.url.indexOf('js/document/templates/montage-html') !== -1) { | 78 | if (this._hackRootFlag && request.url.indexOf('js/document/templates/montage-html') !== -1) { |
79 | //TODO: Optimize creating string | 79 | //TODO: Optimize creating string |
80 | return {redirectUrl: this.application.ninja.coreIoApi.rootUrl+this.application.ninja.documentController.documentHackReference.root.split(this.application.ninja.coreIoApi.cloudData.root)[1]+request.url.split('/')[request.url.split('/').length-1]}; | 80 | return {redirectUrl: this.application.ninja.coreIoApi.rootUrl+this.application.ninja.documentController.documentHackReference.root.split(this.application.ninja.coreIoApi.cloudData.root)[1]+request.url.split('/')[request.url.split('/').length-1]}; |
81 | } | ||
81 | } | 82 | } |
82 | } | ||
83 | }, | 83 | }, |
84 | //////////////////////////////////////////////////////////////////// | 84 | //////////////////////////////////////////////////////////////////// |
85 | // | 85 | // |
@@ -90,7 +90,7 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
90 | } | 90 | } |
91 | }, | 91 | }, |
92 | //////////////////////////////////////////////////////////////////// | 92 | //////////////////////////////////////////////////////////////////// |
93 | 93 | ||
94 | 94 | ||
95 | 95 | ||
96 | 96 | ||
@@ -146,19 +146,10 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
146 | fileSaveResult: { | 146 | fileSaveResult: { |
147 | value: function (result) { | 147 | value: function (result) { |
148 | if(result.status === 204){ | 148 | if(result.status === 204){ |
149 | this.clearDocumentDirtyFlag(); | 149 | this.activeDocument.needsSave = false; |
150 | } | 150 | } |
151 | } | 151 | } |
152 | }, | 152 | }, |
153 | //////////////////////////////////////////////////////////////////// | ||
154 | |||
155 | |||
156 | clearDocumentDirtyFlag:{ | ||
157 | value: function(){ | ||
158 | this.activeDocument.dirtyFlag = false; | ||
159 | } | ||
160 | }, | ||
161 | |||
162 | 153 | ||
163 | createNewFile:{ | 154 | createNewFile:{ |
164 | value:function(newFileObj){ | 155 | value:function(newFileObj){ |
@@ -297,7 +288,7 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
297 | 288 | ||
298 | closeDocument: { | 289 | closeDocument: { |
299 | value: function(id) { | 290 | value: function(id) { |
300 | if(this.activeDocument.dirtyFlag === true){ | 291 | if(this.activeDocument.needsSave === true){ |
301 | //if file dirty then alert user to save | 292 | //if file dirty then alert user to save |
302 | } | 293 | } |
303 | 294 | ||
@@ -480,5 +471,5 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
480 | value: function() { | 471 | value: function() { |
481 | return "userDocument_" + (this._iframeCounter++); | 472 | return "userDocument_" + (this._iframeCounter++); |
482 | } | 473 | } |
483 | } | 474 | } |
484 | }); | 475 | }); |