summaryrefslogtreecommitdiff
path: root/tt-rss.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2005-08-29 08:54:37 +0100
committerAndrew Dolgov <[email protected]>2005-08-29 08:54:37 +0100
commit7ff88e75bd52bd3b1379e4a36a477f6c750ac7b9 (patch)
treea6380f5de7ce6ab03922413ec16f2b9b37c09cde /tt-rss.js
parentad3024fc775bf73c952a5bfbfc2233d18f5af692 (diff)
disable catchupPage button when all headlines have been read
Diffstat (limited to 'tt-rss.js')
-rw-r--r--tt-rss.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/tt-rss.js b/tt-rss.js
index 96c9b32ad..30ed65177 100644
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -393,6 +393,14 @@ function view(id,feed_id) {
// document.getElementById('content').innerHTML='Loading, please wait...';
+ var unread_rows = getVisibleUnreadHeadlines();
+
+ if (unread_rows.length == 0) {
+ var button = document.getElementById("btnCatchupPage");
+ button.className = "disabledButton";
+ button.href = "";
+ }
+
active_post_id = id;
xmlhttp_view.open("GET", "backend.php?op=view&id=" + param_escape(id), true);
@@ -437,6 +445,20 @@ function relativeid_callback() {
}
+function getVisibleUnreadHeadlines() {
+ var content = document.getElementById("headlinesList");
+
+ var rows = new Array();
+
+ for (i = 0; i < content.rows.length; i++) {
+ var row_id = content.rows[i].id.replace("RROW-", "");
+ if (row_id.length > 0 && content.rows[i].className.match("Unread")) {
+ rows.push(row_id);
+ }
+ }
+ return rows;
+}
+
function getVisibleHeadlineIds() {
var content = document.getElementById("headlinesList");