Sha256: 41e7bbbf0417b17a47390fbc8a07110d6725bee12d6eb81c97481200592b3e58
Contents?: true
Size: 599 Bytes
Versions: 23
Compression:
Stored size: 599 Bytes
Contents
class MyDashboard.Comments extends MyDashboard.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
23 entries across 23 versions & 1 rubygems