Sha256: 52b8f9a1dd1adff331794caeee175131f488242a3de360bc36fabc456bead87d

Contents?: true

Size: 539 Bytes

Versions: 6

Compression:

Stored size: 539 Bytes

Contents

namespace "SensuDashboard.Collections", (exports) ->

  class exports.Base extends Backbone.Collection
    longPolling: false

    intervalSeconds: 10

    startLongPolling: (intervalSeconds) =>
      @longPolling = true
      @intervalSeconds = intervalSeconds if intervalSeconds
      @executeLongPolling()

    stopLongPolling: =>
      @longPolling = false

    executeLongPolling: =>
      @fetch
        success: =>
          @onFetch()

    onFetch: =>
      setTimeout(@executeLongPolling, 1000 * @intervalSeconds) if @longPolling

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
sensu-dashboard-0.10.4 lib/sensu-dashboard/assets/javascripts/collections/base.coffee
sensu-dashboard-0.10.3 lib/sensu-dashboard/assets/javascripts/collections/base.coffee
sensu-dashboard-0.10.2 lib/sensu-dashboard/assets/javascripts/collections/base.coffee
sensu-dashboard-0.10.1 lib/sensu-dashboard/assets/javascripts/collections/base.coffee
sensu-dashboard-0.10.0 lib/sensu-dashboard/assets/javascripts/collections/base.coffee
sensu-dashboard-0.9.9 lib/sensu-dashboard/assets/javascripts/collections/base.coffee