From bdfd7a19a30a5dacab47262c8e9758215787f9ca Mon Sep 17 00:00:00 2001 From: doubleface Date: Fri, 14 Jun 2013 08:43:50 -0400 Subject: [PATCH] Update the number of unread items when marking an item as read --- assets/js/app.js | 6 ++++++ templates/unread_items.php | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/assets/js/app.js b/assets/js/app.js index 3cca31c..c32e7de 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -171,6 +171,12 @@ { var item = document.getElementById("item-" + item_id); if (item) item.parentNode.removeChild(item); + + var $unread_span = document.getElementById("unread-count"); + var unread_count = parseInt($unread_span.innerHTML, 10) - 1; + + $unread_span.innerHTML = unread_count; + document.querySelector("title").innerHTML = "miniflux (" + unread_count + ")"; } diff --git a/templates/unread_items.php b/templates/unread_items.php index 02ee0e2..86e8e81 100644 --- a/templates/unread_items.php +++ b/templates/unread_items.php @@ -5,7 +5,7 @@