diff options
author | Jose Antonio Marquez | 2012-06-04 15:34:57 -0700 |
---|---|---|
committer | Jose Antonio Marquez | 2012-06-04 15:34:57 -0700 |
commit | 1b8586c07951accbc3c0f3951966e4e258b0c5d9 (patch) | |
tree | 9a3e9d76bf03f0cf62532c80a4713a8a242955ca /js/document/models | |
parent | 1fa1faf9119e4dd048bd52fd44ab754b6942c319 (diff) | |
download | ninja-1b8586c07951accbc3c0f3951966e4e258b0c5d9.tar.gz |
Adding saving blocking screen
This is for chrome preview, also fixed other preview bug with plain files not opening in preview.
Diffstat (limited to 'js/document/models')
-rwxr-xr-x | js/document/models/base.js | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/js/document/models/base.js b/js/document/models/base.js index 27f7d43f..0957145a 100755 --- a/js/document/models/base.js +++ b/js/document/models/base.js | |||
@@ -99,11 +99,20 @@ exports.BaseDocumentModel = Montage.create(Component, { | |||
99 | //////////////////////////////////////////////////////////////////// | 99 | //////////////////////////////////////////////////////////////////// |
100 | //TODO: Add API to allow other browser support | 100 | //TODO: Add API to allow other browser support |
101 | browserPreview: { | 101 | browserPreview: { |
102 | value: function (browser) { | 102 | value: function (browser, screen, context) { |
103 | //Making call to show feedback screen | ||
104 | if (screen) screen.show(context); | ||
103 | //Generating URL for document | 105 | //Generating URL for document |
104 | var url = this.application.ninja.coreIoApi.rootUrl + this.file.uri.split(this.application.ninja.coreIoApi.cloudData.root)[1]; | 106 | var url = this.application.ninja.coreIoApi.rootUrl + this.file.uri.split(this.application.ninja.coreIoApi.cloudData.root)[1]; |
105 | //TODO: Add logic to prompt user to save (all) before preview | 107 | //TODO: Add logic to prompt user to save (all) before preview |
106 | this.saveAll(null,function (result) { | 108 | this.saveAll(null,function (success) { |
109 | //Making call to show feedback screen | ||
110 | if (screen) screen.hide(context); | ||
111 | //TODO: Add error handling logic | ||
112 | if (!success) { | ||
113 | console.log('Error!'); | ||
114 | return; | ||
115 | } | ||
107 | //Currently only supporting current browser (Chrome, obviously) | 116 | //Currently only supporting current browser (Chrome, obviously) |
108 | switch (this.browser) { | 117 | switch (this.browser) { |
109 | case 'chrome': | 118 | case 'chrome': |