diff options
Diffstat (limited to 'js/document/models/text.js')
-rwxr-xr-x | js/document/models/text.js | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/js/document/models/text.js b/js/document/models/text.js index acb70631..b81a2b13 100755 --- a/js/document/models/text.js +++ b/js/document/models/text.js | |||
@@ -30,19 +30,19 @@ POSSIBILITY OF SUCH DAMAGE. | |||
30 | 30 | ||
31 | //////////////////////////////////////////////////////////////////////// | 31 | //////////////////////////////////////////////////////////////////////// |
32 | // | 32 | // |
33 | var Montage = require("montage/core/core").Montage, | 33 | var Montage = require("montage/core/core").Montage, |
34 | BaseDocumentModel = require("js/document/models/base").BaseDocumentModel; | 34 | BaseDocumentModel = require("js/document/models/base").BaseDocumentModel; |
35 | //////////////////////////////////////////////////////////////////////// | 35 | //////////////////////////////////////////////////////////////////////// |
36 | // | 36 | // |
37 | exports.TextDocumentModel = Montage.create(BaseDocumentModel, { | 37 | exports.TextDocumentModel = Montage.create(BaseDocumentModel, { |
38 | //////////////////////////////////////////////////////////////////// | 38 | //////////////////////////////////////////////////////////////////// |
39 | // | 39 | // |
40 | hasTemplate: { | 40 | hasTemplate: { |
41 | enumerable: false, | 41 | enumerable: false, |
42 | value: false | 42 | value: false |
43 | }, | 43 | }, |
44 | //////////////////////////////////////////////////////////////////// | 44 | //////////////////////////////////////////////////////////////////// |
45 | // | 45 | // |
46 | save: { | 46 | save: { |
47 | enumerable: false, | 47 | enumerable: false, |
48 | value: function (callback) { | 48 | value: function (callback) { |
@@ -58,37 +58,37 @@ exports.TextDocumentModel = Montage.create(BaseDocumentModel, { | |||
58 | } | 58 | } |
59 | }, | 59 | }, |
60 | //////////////////////////////////////////////////////////////////// | 60 | //////////////////////////////////////////////////////////////////// |
61 | // | 61 | // |
62 | handleSaved: { | 62 | handleSaved: { |
63 | value: function (result) { | 63 | value: function (result) { |
64 | // | 64 | // |
65 | if (result.status === 204) { | 65 | if (result.status === 204) { |
66 | this.model.needsSave = false; | 66 | this.model.needsSave = false; |
67 | } | 67 | } |
68 | // | 68 | // |
69 | if (this.callback) this.callback(result); | 69 | if (this.callback) this.callback(result); |
70 | } | 70 | } |
71 | }, | 71 | }, |
72 | //////////////////////////////////////////////////////////////////// | 72 | //////////////////////////////////////////////////////////////////// |
73 | // | 73 | // |
74 | close: { | 74 | close: { |
75 | value: function (view, callback) { | 75 | value: function (view, callback) { |
76 | //Outcome of close (pending on save logic) | 76 | //Outcome of close (pending on save logic) |
77 | var success; | 77 | var success; |
78 | // | 78 | // |
79 | if (this.needsSave) { | 79 | if (this.needsSave) { |
80 | //Prompt user to save of lose data | 80 | //Prompt user to save of lose data |
81 | } else { | 81 | } else { |
82 | //Close file | 82 | //Close file |
83 | success = true; | 83 | success = true; |
84 | } | 84 | } |
85 | // | 85 | // |
86 | this.parentContainer.removeChild(this.views.code.textViewContainer); | 86 | this.parentContainer.removeChild(this.views.code.textViewContainer); |
87 | this.application.ninja.stage.restoreAllPanels(); | 87 | this.application.ninja.stage.restoreAllPanels(); |
88 | this.views.code = null; | 88 | this.views.code = null; |
89 | 89 | ||
90 | // | 90 | // |
91 | return success; | 91 | return success; |
92 | } | 92 | } |
93 | } | 93 | } |
94 | }); | 94 | }); |