aboutsummaryrefslogtreecommitdiff
path: root/js/io/ui
diff options
context:
space:
mode:
Diffstat (limited to 'js/io/ui')
-rwxr-xr-xjs/io/ui/file-picker/file-picker-controller.js2
-rwxr-xr-xjs/io/ui/file-picker/file-picker-model.js6
-rw-r--r--js/io/ui/file-picker/picker-navigator.reel/picker-navigator.js13
-rw-r--r--js/io/ui/save-as-dialog.reel/save-as-dialog.js4
4 files changed, 18 insertions, 7 deletions
diff --git a/js/io/ui/file-picker/file-picker-controller.js b/js/io/ui/file-picker/file-picker-controller.js
index 3b19de83..105dc223 100755
--- a/js/io/ui/file-picker/file-picker-controller.js
+++ b/js/io/ui/file-picker/file-picker-controller.js
@@ -104,7 +104,7 @@ var FilePickerController = exports.FilePickerController = Montage.create(require
104 aModel.topLevelDirectories = topLevelDirectories; 104 aModel.topLevelDirectories = topLevelDirectories;
105 105
106 if(!!topLevelDirectories && !!topLevelDirectories[0]){ 106 if(!!topLevelDirectories && !!topLevelDirectories[0]){
107 aModel.currentRoot = topLevelDirectories[0].uri; 107 aModel.currentRoot = aModel.currentLogicalDrive = topLevelDirectories[0].uri;
108 } 108 }
109 109
110 //populate the last opened folder first, if none then populate default root 110 //populate the last opened folder first, if none then populate default root
diff --git a/js/io/ui/file-picker/file-picker-model.js b/js/io/ui/file-picker/file-picker-model.js
index 09c3ae9c..c92ec586 100755
--- a/js/io/ui/file-picker/file-picker-model.js
+++ b/js/io/ui/file-picker/file-picker-model.js
@@ -73,6 +73,12 @@ exports.FilePickerModel = (require("montage/core/core").Montage).create(require(
73 value:"" 73 value:""
74 }, 74 },
75 75
76 currentLogicalDrive:{
77 writable:true,
78 enumerable:true,
79 value:""
80 },
81
76 callback:{ 82 callback:{
77 writable:true, 83 writable:true,
78 enumerable:true, 84 enumerable:true,
diff --git a/js/io/ui/file-picker/picker-navigator.reel/picker-navigator.js b/js/io/ui/file-picker/picker-navigator.reel/picker-navigator.js
index 428e7bab..7a9d90b4 100644
--- a/js/io/ui/file-picker/picker-navigator.reel/picker-navigator.js
+++ b/js/io/ui/file-picker/picker-navigator.reel/picker-navigator.js
@@ -346,6 +346,11 @@ var PickerNavigator = exports.PickerNavigator = Montage.create(Component, {
346 var arr = []; 346 var arr = [];
347 var temp = new String(uri); 347 var temp = new String(uri);
348 while(temp.indexOf("/") != -1){ 348 while(temp.indexOf("/") != -1){
349
350 if(""+temp === this.pickerModel.currentLogicalDrive){//stop at the logical drive
351 break;
352 }
353
349 temp = temp.substring(0, temp.lastIndexOf("/")); 354 temp = temp.substring(0, temp.lastIndexOf("/"));
350 355
351 //populate dropdown irrespective of validity 356 //populate dropdown irrespective of validity
@@ -560,7 +565,7 @@ var PickerNavigator = exports.PickerNavigator = Montage.create(Component, {
560 enumerable: true, 565 enumerable: true,
561 writable: false, 566 writable: false,
562 value : function(evt, dirObj){ 567 value : function(evt, dirObj){
563 this.currentURI = dirObj.uri; 568 this.currentURI = this.pickerModel.currentLogicalDrive = dirObj.uri;
564 569
565 var status = this.pickerViews()[this.selectedPickerView].call(this, dirObj.uri);//dynamically calls the update function of the current picker view 570 var status = this.pickerViews()[this.selectedPickerView].call(this, dirObj.uri);//dynamically calls the update function of the current picker view
566 571
@@ -861,12 +866,12 @@ var PickerNavigator = exports.PickerNavigator = Montage.create(Component, {
861 var dataStore = window.sessionStorage; 866 var dataStore = window.sessionStorage;
862 try { 867 try {
863 if(this.pickerModel.pickerMode === "write"){ 868 if(this.pickerModel.pickerMode === "write"){
864 dataStore.setItem('lastSavedFolderURI',escape(""+this.currentURI)); 869 dataStore.setItem('lastSavedFolderURI', encodeURI(""+this.currentURI));
865 } 870 }
866 else if(this.pickerModel.inFileMode === true){ 871 else if(this.pickerModel.inFileMode === true){
867 dataStore.setItem('lastOpenedFolderURI_fileSelection',escape(""+this.currentURI)); 872 dataStore.setItem('lastOpenedFolderURI_fileSelection',encodeURI(""+this.currentURI));
868 }else if(this.pickerModel.inFileMode === false){ 873 }else if(this.pickerModel.inFileMode === false){
869 dataStore.setItem('lastOpenedFolderURI_folderSelection',escape(""+this.currentURI)); 874 dataStore.setItem('lastOpenedFolderURI_folderSelection',encodeURI(""+this.currentURI));
870 } 875 }
871 } 876 }
872 catch(e){ 877 catch(e){
diff --git a/js/io/ui/save-as-dialog.reel/save-as-dialog.js b/js/io/ui/save-as-dialog.reel/save-as-dialog.js
index 0a322b99..c60a92f9 100644
--- a/js/io/ui/save-as-dialog.reel/save-as-dialog.js
+++ b/js/io/ui/save-as-dialog.reel/save-as-dialog.js
@@ -111,7 +111,7 @@ var SaveAsDialog = exports.SaveAsDialog = Montage.create(Component, {
111 handleOkButtonAction:{ 111 handleOkButtonAction:{
112 value: function(evt){ 112 value: function(evt){
113 var filename = this.fileName, 113 var filename = this.fileName,
114 newFileDirectory = this.newFileDirectory, 114 newFileDirectory = this.folderUri,
115 success = true; 115 success = true;
116 if(this.isValidFileName(this.fileName) && this.isValidUri(this.folderUri) && !this.checkFileExists(this.fileName, this.folderUri)){ 116 if(this.isValidFileName(this.fileName) && this.isValidUri(this.folderUri) && !this.checkFileExists(this.fileName, this.folderUri)){
117 try{ 117 try{
@@ -128,7 +128,7 @@ var SaveAsDialog = exports.SaveAsDialog = Montage.create(Component, {
128 } 128 }
129 }catch(e){ 129 }catch(e){
130 success = false; 130 success = false;
131 console.log("[ERROR] Failed to save: "+ this.fileName + " at "+ this.newFileDirectory); 131 console.log("[ERROR] Failed to save: "+ this.fileName + " at "+ newFileDirectory);
132 console.log(e.stack); 132 console.log(e.stack);
133 } 133 }
134 134