Skip to content

Instantly share code, notes, and snippets.

@cesutherland
Created April 18, 2012 15:38
Show Gist options
  • Save cesutherland/2414414 to your computer and use it in GitHub Desktop.
Save cesutherland/2414414 to your computer and use it in GitHub Desktop.
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