mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-26 06:21:28 +00:00
dynamically show new label markers in headlines buffer w/o reload
This commit is contained in:
31
viewfeed.js
31
viewfeed.js
@@ -907,7 +907,8 @@ function selectionAssignLabel(id) {
|
||||
|
||||
new Ajax.Request(query, {
|
||||
onComplete: function(transport) {
|
||||
viewCurrentFeed();
|
||||
show_labels_in_headlines(transport);
|
||||
all_counters_callback2(transport);
|
||||
} });
|
||||
|
||||
}
|
||||
@@ -2008,3 +2009,31 @@ function scrollArticle(offset) {
|
||||
exception_error("scrollArticle", e);
|
||||
}
|
||||
}
|
||||
|
||||
function show_labels_in_headlines(transport) {
|
||||
try {
|
||||
if (transport.responseXML) {
|
||||
var info = transport.responseXML.getElementsByTagName("info-for-headlines")[0];
|
||||
|
||||
var elems = info.getElementsByTagName("entry");
|
||||
|
||||
for (var l = 0; l < elems.length; l++) {
|
||||
var e_id = elems[l].getAttribute("id");
|
||||
|
||||
if (e_id) {
|
||||
|
||||
var ctr = document.getElementById("HLLCTR-" + e_id);
|
||||
|
||||
if (ctr) {
|
||||
ctr.innerHTML = elems[l].firstChild.nodeValue;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
exception_error("show_labels_in_headlines", e);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user