Created
February 17, 2019 19:28
-
-
Save choncou/9785deba91c1d4fe47cbdd08fef2f219 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).on('turbolinks:load', () => { | |
linkableElements = $('.js-linkable'); | |
linkableElements.click((e) => { | |
e.preventDefault(); | |
const { delegateTarget } = e; | |
const href = $(delegateTarget).data('href'); | |
Turbolinks.visit(href); | |
}); | |
linkableElements.mouseover((e) => { | |
$(e.delegateTarget).css('cursor', 'pointer'); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment