Created
April 18, 2012 15:38
-
-
Save cesutherland/2414414 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
1153 anchorClick: function(event) { | |
1154 var target = $(event.target); | |
1155 if (target.attr("data-external")) { | |
1156 return; | |
1157 } | |
1158 var href = target.attr("href"); | |
1159 // Route anything that starts with # or / (excluding //domain urls) | |
1160 if (href && (href[0] === '#' || (href[0] === '/' && href[1] !== '/'))) { | |
1161 Backbone.history.navigate(href, true); | |
1162 event.preventDefault(); | |
1163 } | |
1164 } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment