diff options
Diffstat (limited to 'js/controllers')
-rwxr-xr-x | js/controllers/document-controller.js | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js index c31ffbac..3cd2c254 100755 --- a/js/controllers/document-controller.js +++ b/js/controllers/document-controller.js | |||
@@ -100,18 +100,26 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
100 | handleExecuteFileOpen: { | 100 | handleExecuteFileOpen: { |
101 | value: function(event) { | 101 | value: function(event) { |
102 | var pickerSettings = event._event.settings || {}; | 102 | var pickerSettings = event._event.settings || {}; |
103 | pickerSettings.callback = this.openFileWithURI.bind(this); | 103 | //adding callback so that file picker can be opened after checking cloud status |
104 | pickerSettings.pickerMode = "read"; | 104 | this.application.ninja.coreIoApi.cloudAvailable(function(){ |
105 | pickerSettings.inFileMode = true; | 105 | pickerSettings.callback = this.openFileWithURI.bind(this); |
106 | this.application.ninja.filePickerController.showFilePicker(pickerSettings); | 106 | pickerSettings.pickerMode = "read"; |
107 | pickerSettings.inFileMode = true; | ||
108 | this.application.ninja.filePickerController.showFilePicker(pickerSettings); | ||
109 | }.bind(this)); | ||
110 | |||
107 | } | 111 | } |
108 | }, | 112 | }, |
109 | 113 | ||
110 | handleExecuteNewFile: { | 114 | handleExecuteNewFile: { |
111 | value: function(event) { | 115 | value: function(event) { |
112 | var newFileSettings = event._event.settings || {}; | 116 | var newFileSettings = event._event.settings || {}; |
113 | newFileSettings.callback = this.createNewFile.bind(this); | 117 | //adding callback so that new file dialog can be opened after checking cloud status |
114 | this.application.ninja.newFileController.showNewFileDialog(newFileSettings); | 118 | this.application.ninja.coreIoApi.cloudAvailable(function(){ |
119 | newFileSettings.callback = this.createNewFile.bind(this); | ||
120 | this.application.ninja.newFileController.showNewFileDialog(newFileSettings); | ||
121 | }.bind(this)); | ||
122 | |||
115 | } | 123 | } |
116 | }, | 124 | }, |
117 | 125 | ||
@@ -305,6 +313,8 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
305 | this._removeDocumentView(doc.container); | 313 | this._removeDocumentView(doc.container); |
306 | this.application.ninja.stage.stageView.hideRulers(); | 314 | this.application.ninja.stage.stageView.hideRulers(); |
307 | document.getElementById("iframeContainer").style.display="block"; | 315 | document.getElementById("iframeContainer").style.display="block"; |
316 | |||
317 | this.application.ninja.stage.hideCanvas(true); | ||
308 | } | 318 | } |
309 | } | 319 | } |
310 | }, | 320 | }, |