aboutsummaryrefslogtreecommitdiff
path: root/js/io/ui/file-picker/file-picker-controller.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/io/ui/file-picker/file-picker-controller.js')
-rwxr-xr-xjs/io/ui/file-picker/file-picker-controller.js22
1 files changed, 10 insertions, 12 deletions
diff --git a/js/io/ui/file-picker/file-picker-controller.js b/js/io/ui/file-picker/file-picker-controller.js
index 5e4d0be8..3b19de83 100755
--- a/js/io/ui/file-picker/file-picker-controller.js
+++ b/js/io/ui/file-picker/file-picker-controller.js
@@ -19,16 +19,7 @@ var FilePickerController = exports.FilePickerController = Montage.create(require
19 writable:false, 19 writable:false,
20 enumerable:true, 20 enumerable:true,
21 value:function(){ 21 value:function(){
22 var that = this; 22 this.eventManager.addEventListener("openFilePicker", this, false);
23
24 this.eventManager.addEventListener("openFilePicker", function(evt){
25 var settings;
26 if(typeof evt._event.settings !== "undefined"){
27 settings = evt._event.settings;
28 }
29 that.showFilePicker(settings);
30 }, false);
31
32 } 23 }
33 }, 24 },
34 25
@@ -37,6 +28,12 @@ var FilePickerController = exports.FilePickerController = Montage.create(require
37 value: "filePicker" 28 value: "filePicker"
38 }, 29 },
39 30
31 handleOpenFilePicker: {
32 value: function(evt) {
33 this.showFilePicker(evt.detail);
34 }
35 },
36
40 /** 37 /**
41 *this function is used to create an instance of a file picker 38 *this function is used to create an instance of a file picker
42 * 39 *
@@ -128,7 +125,9 @@ var FilePickerController = exports.FilePickerController = Montage.create(require
128 } 125 }
129 126
130 if(!!storedUri){ 127 if(!!storedUri){
131 aModel.currentRoot = unescape(storedUri); 128 // This is depracated -- use decodeURI instead
129 //aModel.currentRoot = unescape(storedUri);
130 aModel.currentRoot = decodeURI(storedUri);
132 } 131 }
133 132
134 if(!!allFileFilters){aModel.fileFilters = allFileFilters;} 133 if(!!allFileFilters){aModel.fileFilters = allFileFilters;}
@@ -137,7 +136,6 @@ var FilePickerController = exports.FilePickerController = Montage.create(require
137 if(typeof pickerMode !== "undefined"){aModel.pickerMode = pickerMode;} 136 if(typeof pickerMode !== "undefined"){aModel.pickerMode = pickerMode;}
138 137
139 138
140
141 //logic: get file content data onDemand from the REST api for the default or last opened root. Cache the data in page [in local cache ? dirty fs? ]. Filter on client side to reduce network calls. 139 //logic: get file content data onDemand from the REST api for the default or last opened root. Cache the data in page [in local cache ? dirty fs? ]. Filter on client side to reduce network calls.
142 this.openFilePickerAsModal(callback, aModel); 140 this.openFilePickerAsModal(callback, aModel);
143 141