From 00615e0dfe8f46af9bd2e20a65b3588f7232cab7 Mon Sep 17 00:00:00 2001 From: Neil Brommer Date: Sat, 30 Dec 2017 19:46:18 -0800 Subject: [PATCH] Animate deleting groups, fix bug where edit mode was exited improperly when deleting groups --- js/editBookmarks.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/js/editBookmarks.js b/js/editBookmarks.js index da0ba58..98bf66e 100644 --- a/js/editBookmarks.js +++ b/js/editBookmarks.js @@ -160,9 +160,19 @@ function deleteGroup(e) { } } - loadBookmarks(); groupsStore.delete(groups.length - 1); db.close(); + + $("#cardList").children().each(function (index, item) { + item = $(item); + if (index == groupIndex) { + item.hide(300, "swing", e => item.remove()); + } else if (index > groupIndex) { + // modify id and data to reflect new index + $(item.children()[0]).attr("data-group-index", index - 1); + item.attr("id", "group-" + (index - 1)); + } + }); } }