X-Git-Url: http://git.bytex64.net/?a=blobdiff_plain;f=www%2Fjssrc%2Fblerg%2FWelcome.js;fp=www%2Fjssrc%2Fblerg%2FWelcome.js;h=ece3d6f00b778373883a8f82b2a2b8fcb8efb8c9;hb=1a21466c7e3f8c18c4c35df56c270546ae8e6434;hp=6b7f2ad52cdf0d97fcb8274f8c6bcde09e1db4a2;hpb=c3a777f760bedf3f196571612a7f3a1b3c707dbf;p=blerg.git diff --git a/www/jssrc/blerg/Welcome.js b/www/jssrc/blerg/Welcome.js index 6b7f2ad..ece3d6f 100644 --- a/www/jssrc/blerg/Welcome.js +++ b/www/jssrc/blerg/Welcome.js @@ -21,9 +21,9 @@ enyo.kind({ {name: "contentBox", allowHtml: true}, {classes: "latest", components: [ {classes: "latest-posts", components: [ - {classes: "latest-scroller", components: [ + {name: "latestPostsScroller", classes: "latest-scroller", onmouseover: "pauseTicker", onmouseout: "startTicker", components: [ {tag: "h2", content: "Latest posts"}, - {name: "latestPosts", onmouseover: "pauseTicker", onmouseout: "startTicker"} + {name: "latestPosts"} ]} ]}, {classes: "latest-tags", components: [ @@ -87,10 +87,17 @@ enyo.kind({ 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) @@ -108,7 +115,7 @@ enyo.kind({ 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 {