{style: "clear: both;"},
{name: "contentBox", allowHtml: true},
{classes: "latest", components: [
- {tag: "h2", content: "Latest posts"},
- {name: "latestPosts", classes: "latest-posts", onmouseover: "pauseTicker", onmouseout: "startTicker"},
- {tag: "h2", content: "Latest tags"},
- {name: "latestTags", classes: "latest-tags"}
+ {classes: "latest-posts", components: [
+ {name: "latestPostsScroller", classes: "latest-scroller", onmouseover: "pauseTicker", onmouseout: "startTicker", components: [
+ {tag: "h2", content: "Latest posts"},
+ {name: "latestPosts"}
+ ]}
+ ]},
+ {classes: "latest-tags", components: [
+ {classes: "latest-scroller", components: [
+ {tag: "h2", content: "Latest tags"},
+ {name: "latestTags"}
+ ]}
+ ]}
]}
],
create: function() {
req.go();
},
startTickerCycle: function() {
- this.tickerTimeout = setTimeout(function() {
- this.$.latestPosts.node.scrollTop = 0;
- this.startTicker();
- }.bind(this), 2500);
+ var starter = function() {
+ if (this.$.latestPostsScroller.hasNode()) {
+ var n = this.$.latestPostsScroller.node;
+ if (n.scrollTop >= n.scrollHeight - n.clientHeight)
+ n.scrollTop = 0;
+ this.startTicker();
+ } else {
+ this.tickerTimeout = setTimeout(starter, 1000);
+ }
+ }.bind(this)
+ this.tickerTimeout = setTimeout(starter, 2500);
},
startTicker: function() {
if (this.tickerInterval)
this.tickerInterval = null;
},
ticker: function() {
- var n = this.$.latestPosts.node;
+ var n = this.$.latestPostsScroller.node;
if (n.scrollTop < n.scrollHeight - n.clientHeight) {
n.scrollTop += 2;
} else {