Sha256: 0855c02f699159fb11406581cfc1ee00f1b51344044137863db5420c6c0a6f25
Contents?: true
Size: 591 Bytes
Versions: 54
Compression:
Stored size: 591 Bytes
Contents
class Dashing.Comments extends Dashing.Widget @accessor 'quote', -> "“#{@get('current_comment')?.body}”" ready: -> @currentIndex = 0 @commentElem = $(@node).find('.comment-container') @nextComment() @startCarousel() onData: (data) -> @currentIndex = 0 startCarousel: -> setInterval(@nextComment, 8000) nextComment: => comments = @get('comments') if comments @commentElem.fadeOut => @currentIndex = (@currentIndex + 1) % comments.length @set 'current_comment', comments[@currentIndex] @commentElem.fadeIn()
Version data entries
54 entries across 54 versions & 7 rubygems