From 6f11b1d2856359aaca5f7ecc27eec8f27e6d8ce6 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 26 Feb 2017 17:37:37 +0300 Subject: do not regenerate entire offline list when something is removed --- js/offline.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'js/offline.js') diff --git a/js/offline.js b/js/offline.js index 90a3132..959982c 100644 --- a/js/offline.js +++ b/js/offline.js @@ -1,5 +1,9 @@ function offline_remove2(elem) { - return offline_remove(elem, populate_list); + var bookId = elem.getAttribute("data-book-id"); + + return offline_remove(bookId, function() { + $("#cell-" + bookId).remove(); + }); } function populate_list() { @@ -35,7 +39,7 @@ function populate_list() { is_read = lastread.total > 0 && lastread.total - lastread.page < 5; } - var cell = "
"; + var cell = "
"; var cover_read = is_read ? "read" : ""; var title_class = in_progress ? "in_progress" : ""; -- cgit v1.2.3