From: Damyan Ivanov Date: Sat, 19 Feb 2022 08:29:13 +0000 (+0000) Subject: fix handling of 'The list has no items' notice X-Git-Url: https://git.ktnx.net/?p=lsl.git;a=commitdiff_plain;h=0958b5fd5eec3ae71f8ea7fa08fc56504dd98a0f fix handling of 'The list has no items' notice --- diff --git a/public/javascripts/lsl.js b/public/javascripts/lsl.js index bd767d3..c594a44 100644 --- a/public/javascripts/lsl.js +++ b/public/javascripts/lsl.js @@ -19,7 +19,8 @@ function add_list_item(data) { item.append($('').text(data.description || '')); item.append($('').text('…')); - $('#list-items').append(item).addClass('have-list-items'); + $('#list-items').append(item); + $('#list-contents').addClass('have-list-items'); } function got_lists_version(new_version) { if (new_version != lists_version) @@ -39,7 +40,8 @@ function load_list_items(uri, target) { // keep track of the last existing item, and append new one // after it, prepending if there is no last existing item // the newly prepended/inserted item becomes the last existing - var item_list = $('#list-items').empty().removeClass('have-list-items'); + $('#list-contents').removeClass('have-list-items'); + var item_list = $('#list-items').empty(); $.each(item_data.items, (i,item) => { add_list_item(item);