aboutsummaryrefslogtreecommitdiff
path: root/js/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'js/controllers')
-rwxr-xr-xjs/controllers/document-controller.js22
1 files changed, 15 insertions, 7 deletions
diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js
index f8507086..e279d5c5 100755
--- a/js/controllers/document-controller.js
+++ b/js/controllers/document-controller.js
@@ -70,7 +70,7 @@ var DocumentController = exports.DocumentController = Montage.create(Component,
70 value: function (request) { 70 value: function (request) {
71 if (request.url.indexOf('js/document/templates/montage-html') !== -1) { 71 if (request.url.indexOf('js/document/templates/montage-html') !== -1) {
72 72
73 console.log(request); 73 //console.log(request);
74 74
75 //TODO: Figure out why active document is not available here 75 //TODO: Figure out why active document is not available here
76 76
@@ -98,18 +98,26 @@ var DocumentController = exports.DocumentController = Montage.create(Component,
98 handleExecuteFileOpen: { 98 handleExecuteFileOpen: {
99 value: function(event) { 99 value: function(event) {
100 var pickerSettings = event._event.settings || {}; 100 var pickerSettings = event._event.settings || {};
101 pickerSettings.callback = this.openFileWithURI.bind(this); 101 //adding callback so that file picker can be opened after checking cloud status
102 pickerSettings.pickerMode = "read"; 102 this.application.ninja.coreIoApi.cloudAvailable(function(){
103 pickerSettings.inFileMode = true; 103 pickerSettings.callback = this.openFileWithURI.bind(this);
104 this.application.ninja.filePickerController.showFilePicker(pickerSettings); 104 pickerSettings.pickerMode = "read";
105 pickerSettings.inFileMode = true;
106 this.application.ninja.filePickerController.showFilePicker(pickerSettings);
107 }.bind(this));
108
105 } 109 }
106 }, 110 },
107 111
108 handleExecuteNewFile: { 112 handleExecuteNewFile: {
109 value: function(event) { 113 value: function(event) {
110 var newFileSettings = event._event.settings || {}; 114 var newFileSettings = event._event.settings || {};
111 newFileSettings.callback = this.createNewFile.bind(this); 115 //adding callback so that new file dialog can be opened after checking cloud status
112 this.application.ninja.newFileController.showNewFileDialog(newFileSettings); 116 this.application.ninja.coreIoApi.cloudAvailable(function(){
117 newFileSettings.callback = this.createNewFile.bind(this);
118 this.application.ninja.newFileController.showNewFileDialog(newFileSettings);
119 }.bind(this));
120
113 } 121 }
114 }, 122 },
115 123