mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-23 13:41:29 +00:00
headline inline search: automatically fix odd/even classes
This commit is contained in:
22
viewfeed.js
22
viewfeed.js
@@ -1679,6 +1679,24 @@ function cdmExpandArticle(a_id) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function fixHeadlinesOrder(ids) {
|
||||||
|
try {
|
||||||
|
for (var i = 0; i < ids.length; i++) {
|
||||||
|
var e = document.getElementById("RROW-" + ids[i]);
|
||||||
|
|
||||||
|
if (e) {
|
||||||
|
if (i % 2 == 0) {
|
||||||
|
e.className = e.className.replace("even", "odd");
|
||||||
|
} else {
|
||||||
|
e.className = e.className.replace("odd", "even");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
exception_error("fixHeadlinesOrder", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function subtoolbarSearch() {
|
function subtoolbarSearch() {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -1690,6 +1708,7 @@ function subtoolbarSearch() {
|
|||||||
q = q.value.toUpperCase();
|
q = q.value.toUpperCase();
|
||||||
|
|
||||||
var ids = false;
|
var ids = false;
|
||||||
|
var vis_ids = new Array();
|
||||||
|
|
||||||
if (document.getElementById("headlinesList")) {
|
if (document.getElementById("headlinesList")) {
|
||||||
ids = getVisibleHeadlineIds();
|
ids = getVisibleHeadlineIds();
|
||||||
@@ -1705,10 +1724,13 @@ function subtoolbarSearch() {
|
|||||||
Element.hide(document.getElementById("RROW-" + ids[i]));
|
Element.hide(document.getElementById("RROW-" + ids[i]));
|
||||||
} else {
|
} else {
|
||||||
Element.show(document.getElementById("RROW-" + ids[i]));
|
Element.show(document.getElementById("RROW-" + ids[i]));
|
||||||
|
vis_ids.push(ids[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fixHeadlinesOrder(vis_ids);
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
exception_error("subtoolbarSearch", e);
|
exception_error("subtoolbarSearch", e);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user