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

Version Path
smashing-1.3.6 templates/project/widgets/comments/comments.coffee
smashing-1.3.5 templates/project/widgets/comments/comments.coffee
smashing-1.3.4 templates/project/widgets/comments/comments.coffee
smashing-1.3.3 templates/project/widgets/comments/comments.coffee
smashing-1.3.2 templates/project/widgets/comments/comments.coffee
smashing-1.3.1 templates/project/widgets/comments/comments.coffee
smashing-1.3.0 templates/project/widgets/comments/comments.coffee
smashing-1.2.0 templates/project/widgets/comments/comments.coffee
smashing-1.1.0 templates/project/widgets/comments/comments.coffee
dashing-rails-2.6.2 vendor/assets/javascripts/dashing/default_widgets/comments.coffee
dashing-rails-2.6.1 vendor/assets/javascripts/dashing/default_widgets/comments.coffee
dashing-rails-2.6.0 vendor/assets/javascripts/dashing/default_widgets/comments.coffee
smashing-1.0.0 templates/project/widgets/comments/comments.coffee
dashing-1.3.7 templates/project/widgets/comments/comments.coffee
dashing-1.3.6 templates/project/widgets/comments/comments.coffee
dashing-rails-2.5.0 vendor/assets/javascripts/dashing/default_widgets/comments.coffee
dashing-rails-2.4.5 vendor/assets/javascripts/dashing/default_widgets/comments.coffee
dashing-rails-2.4.4 vendor/assets/javascripts/dashing/default_widgets/comments.coffee
baseboard-1.0.2 templates/project/widgets/comments/comments.coffee
baseboard-1.0.1 templates/project/widgets/comments/comments.coffee