Browse files

Fixed keybindings template to work with turbolinks.

Turbolinks requires the JS to listen on the page:change event.
  • Loading branch information...
1 parent 7beb786 commit 5de7bdfd47c82dece41fd0364b3821a77e5dbe3f @thierry-rietsch thierry-rietsch committed Sep 12, 2013
Showing with 6 additions and 0 deletions.
  1. +6 −0 lib/generators/mousetrap/install/templates/keybindings.js.coffee
View
6 lib/generators/mousetrap/install/templates/keybindings.js.coffee
@@ -1,4 +1,10 @@
$ ->
+ handleKeyBindings()
+
+$(document).on 'page:change', ->
+ handleKeyBindings()
+
+handleKeyBindings = ->
# Hotkey binding to links with 'data-keybinding' attribute
# Navigate link when hotkey pressed
$('a[data-keybinding]').each (i, el) ->

0 comments on commit 5de7bdf

Please sign in to comment.