diff options
author | Jose Antonio Marquez Russo | 2012-02-22 12:11:32 -0800 |
---|---|---|
committer | Jose Antonio Marquez Russo | 2012-02-22 12:11:32 -0800 |
commit | 74d5c26dfb61093a55218cf576096f3355b845cb (patch) | |
tree | 1ba4a7e0bdef535fcb8ea90962e66bedf45b40fa /js/io/ui/new-file-dialog/new-file-location.reel | |
parent | 27589634d3e8ea52abe8623f8f2cc48ce0aa04c9 (diff) | |
parent | 91f6f672ee96c6e7e942b555af7057d6db52d90f (diff) | |
download | ninja-74d5c26dfb61093a55218cf576096f3355b845cb.tar.gz |
Merge pull request #15 from mencio/file-io
moving the default folder location to the navigator to fix the ok button issue
Diffstat (limited to 'js/io/ui/new-file-dialog/new-file-location.reel')
-rwxr-xr-x | js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js | 28 |
1 files changed, 0 insertions, 28 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 849c665c..0e1e09a4 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,34 +18,6 @@ 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. | ||
22 | prepareForDraw: { | ||
23 | value: function() { | ||
24 | var defaultSaveDirectory; | ||
25 | |||
26 | // Using session storage location | ||
27 | if(window.sessionStorage) { | ||
28 | var storedFolder = window.sessionStorage.getItem("lastOpenedFolderURI_folderSelection"); | ||
29 | if(storedFolder) defaultSaveDirectory = decodeURI(window.sessionStorage.getItem("lastOpenedFolderURI_folderSelection")); | ||
30 | } | ||
31 | |||
32 | // Use default if none found in session storage | ||
33 | if(!defaultSaveDirectory) { | ||
34 | var driveData = this.application.ninja.coreIoApi.getDirectoryContents({uri:"", recursive:false, returnType:"all"}); | ||
35 | if(driveData.success){ | ||
36 | var topLevelDirectories = (JSON.parse(driveData.content)).children; | ||
37 | defaultSaveDirectory = topLevelDirectories[0].uri; | ||
38 | } else { | ||
39 | console.log("** Error ** Cannot get directory listing"); | ||
40 | defaultSaveDirectory = ""; | ||
41 | } | ||
42 | } | ||
43 | |||
44 | // Set the input field to the correct directory | ||
45 | this.fileInputField.newFileDirectory.value = defaultSaveDirectory; | ||
46 | } | ||
47 | }, | ||
48 | |||
49 | didDraw: { | 21 | didDraw: { |
50 | value: function() { | 22 | value: function() { |
51 | this.fileInputField.selectDirectory = true; | 23 | this.fileInputField.selectDirectory = true; |