diff options
author | Eric Guzman | 2012-02-29 16:13:19 -0800 |
---|---|---|
committer | Eric Guzman | 2012-02-29 16:13:19 -0800 |
commit | 53bdb1e7773069c4cca59e88d6da91cd0f58c94a (patch) | |
tree | 44a2147fcbb43ea483f78a1e2e082919f9c81970 /js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js | |
parent | b2c60efb9c6f5dfa7b0fc5c2b9feebebc805ed97 (diff) | |
parent | b09956e4a9a35c5588cc7cd1f01efb617cbe0884 (diff) | |
download | ninja-53bdb1e7773069c4cca59e88d6da91cd0f58c94a.tar.gz |
Merge branch 'refs/heads/master' into CSSPanelUpdates
Conflicts:
js/panels/PanelContainer/PanelContainer.reel/PanelContainer.js
Diffstat (limited to 'js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js')
-rw-r--r-- | js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js | 36 |
1 files changed, 29 insertions, 7 deletions
diff --git a/js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js b/js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js index 11b322fe..aaf39005 100644 --- a/js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js +++ b/js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js | |||
@@ -47,14 +47,36 @@ var NewFileOptionsNavigator = exports.NewFileOptionsNavigator = Montage.create(C | |||
47 | enumerable:false, | 47 | enumerable:false, |
48 | value:"0 px" | 48 | value:"0 px" |
49 | }, | 49 | }, |
50 | willDraw: { | 50 | |
51 | enumerable: false, | 51 | // Populating the directory input field with the default save location or the last stored location. |
52 | value: function() {} | 52 | prepareForDraw: { |
53 | }, | 53 | value: function() { |
54 | draw: { | 54 | var defaultSaveDirectory; |
55 | enumerable: false, | 55 | |
56 | value: function() {} | 56 | // Using session storage location |
57 | if(window.sessionStorage) { | ||
58 | var storedFolder = window.sessionStorage.getItem("lastOpenedFolderURI_folderSelection"); | ||
59 | if(storedFolder) defaultSaveDirectory = decodeURI(window.sessionStorage.getItem("lastOpenedFolderURI_folderSelection")); | ||
60 | } | ||
61 | |||
62 | // Use default if none found in session storage | ||
63 | if(!defaultSaveDirectory) { | ||
64 | var driveData = this.application.ninja.coreIoApi.getDirectoryContents({uri:"", recursive:false, returnType:"all"}); | ||
65 | if(driveData.success){ | ||
66 | var topLevelDirectories = (JSON.parse(driveData.content)).children; | ||
67 | defaultSaveDirectory = topLevelDirectories[0].uri; | ||
68 | } else { | ||
69 | console.log("** Error ** Cannot get directory listing"); | ||
70 | defaultSaveDirectory = ""; | ||
71 | } | ||
72 | } | ||
73 | |||
74 | // Set the input field to the correct directory | ||
75 | this.newFileLocation.fileInputField.newFileDirectory.value = defaultSaveDirectory; | ||
76 | this.newFileDirectory = defaultSaveDirectory; | ||
77 | } | ||
57 | }, | 78 | }, |
79 | |||
58 | didDraw: { | 80 | didDraw: { |
59 | enumerable: false, | 81 | enumerable: false, |
60 | value: function() { | 82 | value: function() { |