From 69983b800d0179fcccd5b61b64ed22c02e22b93a Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Tue, 21 Feb 2012 22:43:45 -0800 Subject: Adding some comments. Signed-off-by: Valerio Virgillito --- js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'js/io/ui/new-file-dialog') 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, { value:"25 px" }, + // Populating the directory input field with the default save location or the last stored location. prepareForDraw: { value: function() { - // Populate the file input field by using the session storage or the default user folder var defaultSaveDirectory; + // Using session storage location if(window.sessionStorage) { var storedFolder = window.sessionStorage.getItem("lastOpenedFolderURI_folderSelection"); if(storedFolder) defaultSaveDirectory = decodeURI(window.sessionStorage.getItem("lastOpenedFolderURI_folderSelection")); } + // Use default if none found in session storage if(!defaultSaveDirectory) { var driveData = this.application.ninja.coreIoApi.getDirectoryContents({uri:"", recursive:false, returnType:"all"}); if(driveData.success){ @@ -39,6 +41,7 @@ var NewFileLocation = exports.NewFileLocation = Montage.create(Component, { } } + // Set the input field to the correct directory this.fileInputField.newFileDirectory.value = defaultSaveDirectory; } }, -- cgit v1.2.3