aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xjs/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js b/js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js
index ee2847ca..849c665c 100755
--- a/js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js
+++ b/js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js
@@ -18,16 +18,18 @@ var NewFileLocation = exports.NewFileLocation = Montage.create(Component, {
18 value:"25 px" 18 value:"25 px"
19 }, 19 },
20 20
21 // Populating the directory input field with the default save location or the last stored location.
21 prepareForDraw: { 22 prepareForDraw: {
22 value: function() { 23 value: function() {
23 // Populate the file input field by using the session storage or the default user folder
24 var defaultSaveDirectory; 24 var defaultSaveDirectory;
25 25
26 // Using session storage location
26 if(window.sessionStorage) { 27 if(window.sessionStorage) {
27 var storedFolder = window.sessionStorage.getItem("lastOpenedFolderURI_folderSelection"); 28 var storedFolder = window.sessionStorage.getItem("lastOpenedFolderURI_folderSelection");
28 if(storedFolder) defaultSaveDirectory = decodeURI(window.sessionStorage.getItem("lastOpenedFolderURI_folderSelection")); 29 if(storedFolder) defaultSaveDirectory = decodeURI(window.sessionStorage.getItem("lastOpenedFolderURI_folderSelection"));
29 } 30 }
30 31
32 // Use default if none found in session storage
31 if(!defaultSaveDirectory) { 33 if(!defaultSaveDirectory) {
32 var driveData = this.application.ninja.coreIoApi.getDirectoryContents({uri:"", recursive:false, returnType:"all"}); 34 var driveData = this.application.ninja.coreIoApi.getDirectoryContents({uri:"", recursive:false, returnType:"all"});
33 if(driveData.success){ 35 if(driveData.success){
@@ -39,6 +41,7 @@ var NewFileLocation = exports.NewFileLocation = Montage.create(Component, {
39 } 41 }
40 } 42 }
41 43
44 // Set the input field to the correct directory
42 this.fileInputField.newFileDirectory.value = defaultSaveDirectory; 45 this.fileInputField.newFileDirectory.value = defaultSaveDirectory;
43 } 46 }
44 }, 47 },