Sha256: 0abe97645f1865b10ab3e808494a883e8b9ca0f0fd299e2146940946da308eeb

Contents?: true

Size: 485 Bytes

Versions: 33

Compression:

Stored size: 485 Bytes

Contents

class AMALayout.Notifications
  constructor: () ->
    $(document).on 'click', '[data-notifications-toggle]', (event) =>
      event.preventDefault();
      badge = event.currentTarget
      if $(badge).find('[data-notification-count]').remove().size()
        @request()

  request: () ->
    $.ajax(
      type: 'DELETE',
      url: '/ama_layout/api/v1/notifications',
      timeout: 10000
    )

$(document).ready ->
  window.AMALayout.notifications = new AMALayout.Notifications()

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
ama_layout-11.5.1 app/assets/javascripts/ama_layout/notifications.coffee
ama_layout-11.5.0 app/assets/javascripts/ama_layout/notifications.coffee
ama_layout-11.4.0 app/assets/javascripts/ama_layout/notifications.coffee
ama_layout-11.3.1 app/assets/javascripts/ama_layout/notifications.coffee
ama_layout-11.3.0 app/assets/javascripts/ama_layout/notifications.coffee
ama_layout-11.2.0 app/assets/javascripts/ama_layout/notifications.coffee
ama_layout-11.1.0 app/assets/javascripts/ama_layout/notifications.coffee
ama_layout-10.2.0 app/assets/javascripts/ama_layout/notifications.coffee
ama_layout-10.1.0 app/assets/javascripts/ama_layout/notifications.coffee
ama_layout-10.0.1 app/assets/javascripts/ama_layout/notifications.coffee
ama_layout-9.5.3 app/assets/javascripts/ama_layout/notifications.coffee
ama_layout-9.5.2 app/assets/javascripts/ama_layout/notifications.coffee
ama_layout-9.5.1 app/assets/javascripts/ama_layout/notifications.coffee
ama_layout-9.5.0 app/assets/javascripts/ama_layout/notifications.coffee
ama_layout-9.4.1 app/assets/javascripts/ama_layout/notifications.coffee
ama_layout-9.4.0 app/assets/javascripts/ama_layout/notifications.coffee
ama_layout-9.3.0 app/assets/javascripts/ama_layout/notifications.coffee
ama_layout-9.2.0 app/assets/javascripts/ama_layout/notifications.coffee
ama_layout-9.1.0 app/assets/javascripts/ama_layout/notifications.coffee
ama_layout-9.0.0 app/assets/javascripts/ama_layout/notifications.coffee