diff --git a/dashboard-ui/scripts/directorybrowser.js b/dashboard-ui/scripts/directorybrowser.js index 4397cfc8b4..7c711b87b1 100644 --- a/dashboard-ui/scripts/directorybrowser.js +++ b/dashboard-ui/scripts/directorybrowser.js @@ -1,6 +1,6 @@ (function (window, document, $) { - function refreshDirectoryBrowser(page, path) { + function refreshDirectoryBrowser(page, path, fileOptions) { Dashboard.showLoadingMsg(); @@ -16,7 +16,7 @@ promise = ApiClient.getNetworkDevices(); } else if (path) { - promise = ApiClient.getDirectoryContents(path, { includeDirectories: true }); + promise = ApiClient.getDirectoryContents(path, fileOptions); } else { promise = ApiClient.getDrives(); } @@ -46,18 +46,20 @@ parentPath = "Network"; } - html += '
' + options.instruction + '
'; html += ''; html += ''; @@ -129,21 +144,26 @@ $(this).off("click").off("change").off("popupafterclose").remove(); - }).on("click", ".lnkDirectory", function () { + }).on("click", ".lnkPath", function () { var path = this.getAttribute('data-path'); - refreshDirectoryBrowser(page, path); + if ($(this).hasClass('lnkFile')) { + $('#txtDirectoryPickerPath', page).val(path); + } else { + refreshDirectoryBrowser(page, path, fileOptions); + } + }).on("click", ".btnRefreshDirectories", function () { var path = $('#txtDirectoryPickerPath', page).val(); - refreshDirectoryBrowser(page, path); + refreshDirectoryBrowser(page, path, fileOptions); }).on("change", "#txtDirectoryPickerPath", function () { - refreshDirectoryBrowser(page, this.value); + refreshDirectoryBrowser(page, this.value, fileOptions); }); var txtCurrentPath = $('#txtDirectoryPickerPath', popup);