From 6afdc783606cda014333787f4911557ff680c31f Mon Sep 17 00:00:00 2001 From: Terry Geng Date: Sat, 15 Jan 2022 22:39:47 -0500 Subject: [PATCH] fix(web): Directory selection being wrongly ignored while jumping through pages. Fix #305. --- web/js/main.mjs | 13 ++++++++----- web/templates/index.template.html | 1 - 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/web/js/main.mjs b/web/js/main.mjs index c82acc6..1ecd118 100644 --- a/web/js/main.mjs +++ b/web/js/main.mjs @@ -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) { - $('').appendTo(select); - $('').appendTo(filter_dir); + $('