]> git.ktnx.net Git - lsl.git/commitdiff
fix removal of 'selected' class of the previously selected list
authorDamyan Ivanov <dmn@debian.org>
Wed, 16 Feb 2022 17:08:02 +0000 (17:08 +0000)
committerDamyan Ivanov <dmn@debian.org>
Wed, 16 Feb 2022 17:08:02 +0000 (17:08 +0000)
public/javascripts/lsl.js

index a21cb3ba1b53514ec4b635a8c70b08cb5b37e73f..851d7090df164cf0788e05beab599fc99c4460e8 100644 (file)
@@ -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');