From 7ba6d597edfe5449c6fab136310d007154c7e96d Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Wed, 16 Feb 2022 17:08:02 +0000 Subject: [PATCH] fix removal of 'selected' class of the previously selected list --- public/javascripts/lsl.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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'); -- 2.39.5