diff options
author | Valerio Virgillito | 2012-02-21 22:43:45 -0800 |
---|---|---|
committer | Valerio Virgillito | 2012-02-21 22:43:45 -0800 |
commit | 69983b800d0179fcccd5b61b64ed22c02e22b93a (patch) | |
tree | 241927dd42a4aaf1b2f52f54e20f937810c9d103 /js | |
parent | a8f5dcd8e85af6600f2e2b6a4536f05fd0c9916d (diff) | |
download | ninja-69983b800d0179fcccd5b61b64ed22c02e22b93a.tar.gz |
Adding some comments.
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'js')
-rwxr-xr-x | js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js | 5 |
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 | }, |