JS event handler should not be attached to document objects multiple time.

Issue #104 resolved
Jimmy Chu created an issue

With rails turbolink and js event attachment, in common.js.coffee:

$(document).on "page:change", ->
  $('.modal').on 'shown.bs.modal', (e) ->
    $(e.target).find('[autofocus]').focus()

These codes will attached to a certain object multiple times after browsing pages back and forth.

Comments (2)

  1. Log in to comment