Skip to content

Commit

Permalink
fixed the better relative determination
Browse files Browse the repository at this point in the history
  • Loading branch information
tbranyen committed Jun 28, 2012
1 parent 257897e commit ad9327a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ function(app, Router) {
// Get the absolute root.
var root = location.protocol + "//" + location.host + app.root;

// Ensure the protocol is not part of URL, meaning it's relative.
if (href && href.indexOf(location.protocol)) {
// Ensure the root is part of the anchor href, meaning it's relative.
if (href && href.slice(root.length) === root) {
// Stop the default event to ensure the link will not cause a page
// refresh.
evt.preventDefault();
Expand Down

0 comments on commit ad9327a

Please sign in to comment.