Created
January 16, 2015 01:39
-
-
Save JacksonGariety/05004b669cfd699c2c2b to your computer and use it in GitHub Desktop.
kill link click-throughs for Backbone
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
// Kill link click-throughs | |
$(document).on('click', 'a:not([data-bypass])', function (event) { | |
if (history.pushState && this.host === window.location.host) { | |
event.preventDefault() | |
event.stopPropagation() | |
App.getInstance().router.navigate(this.pathname, true) | |
$.reset(this) | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment