summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2013-07-16 09:59:14 +0400
committerAndrew Dolgov <[email protected]>2013-07-16 09:59:14 +0400
commit41d37fb2c39b2b270981dac423e3d6c55293048d (patch)
tree26e16c79c823851bf718a5093e3f5a0e6b63283b /js
parent39d61109e6a88930d8a70e8a8dd5bf1b115b0161 (diff)
add experimental hack to show row unread status in floating title
Diffstat (limited to 'js')
-rw-r--r--js/viewfeed.js30
1 files changed, 21 insertions, 9 deletions
diff --git a/js/viewfeed.js b/js/viewfeed.js
index 9a13f8c05..0a20cabcf 100644
--- a/js/viewfeed.js
+++ b/js/viewfeed.js
@@ -835,6 +835,8 @@ function selectionToggleUnread(set_state, callback, no_error, ids) {
}
}
+ updateFloatingTitle(true);
+
if (rows.length > 0) {
var cmode = "";
@@ -1742,6 +1744,7 @@ function cdmClicked(event, id) {
if (article_is_unread) {
decrementFeedCounter(getActiveFeedId(), activeFeedIsCat());
+ updateFloatingTitle(true);
}
var query = "?op=rpc&method=catchupSelected" +
@@ -2257,8 +2260,10 @@ function scrollToRowId(id) {
}
}
-function updateFloatingTitle() {
+function updateFloatingTitle(unread_only) {
try {
+ if (!isCdmMode()) return;
+
var hf = $("headlines-frame");
var elems = $$("#headlines-frame > div[id*=RROW]");
@@ -2271,17 +2276,24 @@ function updateFloatingTitle() {
var header = child.getElementsByClassName("cdmHeader")[0];
- if (child.id != $("floatingTitle").getAttribute("rowid")) {
- $("floatingTitle").setAttribute("rowid", child.id);
- $("floatingTitle").innerHTML = header.innerHTML;
- $("floatingTitle").firstChild.innerHTML = "<img class='anchor markedPic' src='images/page_white_go.png' onclick=\"scrollToRowId('"+child.id+"')\">" + $("floatingTitle").firstChild.innerHTML;
+ if (unread_only || child.id != $("floatingTitle").getAttribute("rowid")) {
+ if (child.id != $("floatingTitle").getAttribute("rowid")) {
+ $("floatingTitle").setAttribute("rowid", child.id);
+ $("floatingTitle").innerHTML = header.innerHTML;
+ $("floatingTitle").firstChild.innerHTML = "<img class='anchor markedPic' src='images/page_white_go.png' onclick=\"scrollToRowId('"+child.id+"')\">" + $("floatingTitle").firstChild.innerHTML;
- initFloatingMenu();
+ initFloatingMenu();
- var cb = $$("#floatingTitle .dijitCheckBox")[0];
+ var cb = $$("#floatingTitle .dijitCheckBox")[0];
+
+ if (cb)
+ cb.parentNode.removeChild(cb);
+ }
- if (cb)
- cb.parentNode.removeChild(cb);
+ if (child.hasClassName("Unread"))
+ $("floatingTitle").addClassName("Unread");
+ else
+ $("floatingTitle").removeClassName("Unread");
PluginHost.run(PluginHost.HOOK_FLOATING_TITLE, child);
}