fix(web): Directory selection being wrongly ignored while jumping through pages.

Fix #305.
This commit is contained in:
Terry Geng 2022-01-15 22:39:47 -05:00
parent 82fa35d4b0
commit 6afdc78360
2 changed files with 8 additions and 6 deletions

View File

@ -536,15 +536,18 @@ function displayLibraryControls(data) {
$('.library-delete').hide();
}
const select = $('#filter-dir');
const dataList = $('#upload-target-dirs');
select.find('option').remove();
dataList.find('option').remove();
const dirs = [];
filter_dir.find('option').each(function(i, dir_element){
dirs.push(dir_element.value);
});
if (data.dirs.length > 0) {
console.log(data.dirs);
data.dirs.forEach(function(dir) {
$('<option value="' + dir + '">' + dir + '</option>').appendTo(select);
if(!dirs.includes(dir)) {
$('<option value="' + dir + '">' + dir + '</option>').appendTo(filter_dir);
$('<option value="' + dir + '">').appendTo(dataList);
}
});
}

View File

@ -180,7 +180,6 @@
<label for="filter-dir">{{ tr('directory') }}</label>
<div id="filter-path" class="input-group mb-2">
<select class="form-control form-control-sm" id="filter-dir" disabled>
<option value="">.</option>
</select>
</div>