# Place all the behaviors and hooks related to the matching controller here. # All this logic will automatically be available in application.js. # You can use CoffeeScript in this file: http://coffeescript.org/ markNotificationsAsRead = -> if $('.notification.unread:visible').length > 0 $.ajax url: '/notifications/read_all' type: 'PATCH' $ -> markNotificationsAsRead() $('#notifications-menu').parent('.dropdown').on 'shown.bs.dropdown', -> markNotificationsAsRead()