Make collapsing feed article lists
This commit is contained in:
parent
0b2888d4a8
commit
124f6ac7ad
2 changed files with 14 additions and 2 deletions
|
@ -260,8 +260,11 @@ App.prototype.populateList = function() {
|
||||||
var artidx = 0;
|
var artidx = 0;
|
||||||
for (i = 0; i < byfeed.length; ++i) {
|
for (i = 0; i < byfeed.length; ++i) {
|
||||||
var feed = byfeed[i];
|
var feed = byfeed[i];
|
||||||
html_str += "<li>" + feed[0].feed_title;
|
html_str += '<li><span' +
|
||||||
html_str += "<ul>";
|
' onclick="return(toggleFeed(' + i.toString() + '));"' +
|
||||||
|
'>' + feed[0].feed_title + '</span>';
|
||||||
|
var feedid = '"feed' + i.toString() + '"';
|
||||||
|
html_str += '<ul id=' + feedid + ' style="display: none;">'
|
||||||
for (var j = 0; j < feed.length; ++j) {
|
for (var j = 0; j < feed.length; ++j) {
|
||||||
article = ua[artidx];
|
article = ua[artidx];
|
||||||
html_str += "<li"+ (article.unread ?
|
html_str += "<li"+ (article.unread ?
|
||||||
|
|
|
@ -8,6 +8,15 @@ function debug(obj) {
|
||||||
alert(obj)
|
alert(obj)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function toggleFeed(feedid) {
|
||||||
|
var e = document.getElementById("feed" + feedid.toString());
|
||||||
|
if (e.style.display == "none") {
|
||||||
|
e.style.display = "";
|
||||||
|
} else {
|
||||||
|
e.style.display = "none";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function $(obj) {
|
function $(obj) {
|
||||||
if(typeof obj == "string") return document.querySelector(obj);
|
if(typeof obj == "string") return document.querySelector(obj);
|
||||||
else return obj;
|
else return obj;
|
||||||
|
|
Reference in a new issue