1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

fix directory browser parent path

This commit is contained in:
Luke Pulverenti 2016-01-29 23:55:05 -05:00
parent 0c696294ae
commit e4fcafe7aa
9 changed files with 35 additions and 68 deletions

View file

@ -25,6 +25,9 @@
function refreshDirectoryBrowser(page, path, fileOptions) {
if (path && typeof(path) !== 'string') {
throw new Error('invalid path');
}
Dashboard.showLoadingMsg();
if (path) {
@ -33,27 +36,20 @@
$('.networkHeadline').show();
}
var promise;
var parentPathPromise = null;
var promises = [];
if (path === "Network") {
promise = ApiClient.getNetworkDevices();
promises.push(ApiClient.getNetworkDevices());
}
else if (path) {
promise = ApiClient.getDirectoryContents(path, fileOptions);
parentPathPromise = ApiClient.getParentPath(path);
promises.push(ApiClient.getDirectoryContents(path, fileOptions));
promises.push(ApiClient.getParentPath(path));
} else {
promise = ApiClient.getDrives();
promises.push(ApiClient.getDrives());
}
if (!parentPathPromise) {
parentPathPromise = new Promise(function (resolve, reject) {
resolve();
});
}
Promise.all([promise, parentPathPromise]).then(function (responses) {
Promise.all(promises).then(function (responses) {
var folders = responses[0];
var parentPath = responses[1] || '';
@ -167,8 +163,6 @@
} else {
refreshDirectoryBrowser(content, path, fileOptions);
}
}).on("click", ".btnRefreshDirectories", function () {
var path = $('#txtDirectoryPickerPath', content).val();