From: Damyan Ivanov Date: Wed, 16 Feb 2022 17:08:02 +0000 (+0000) Subject: fix removal of 'selected' class of the previously selected list X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=7ba6d597edfe5449c6fab136310d007154c7e96d;p=lsl.git fix removal of 'selected' class of the previously selected list --- diff --git a/public/javascripts/lsl.js b/public/javascripts/lsl.js index a21cb3b..851d709 100644 --- a/public/javascripts/lsl.js +++ b/public/javascripts/lsl.js @@ -24,8 +24,6 @@ function load_list_items(uri, target) { $.get(uri) .done(item_data => { target.data('items', item_data); - if (selected_list) - selected_list.removeClass('selected'); var item_list = $('#list-items').empty().removeClass('have-list-items'); @@ -42,6 +40,8 @@ function select_list(new_selected_list) { var id_data = new_selected_list.data('id'); + if (selected_list) + selected_list.removeClass('selected'); load_list_items(id_data.uri, new_selected_list); selected_list = new_selected_list; selected_list.addClass('selected');