Skip to content

Commit

Permalink
Merge pull request #235 from spudly/master
Browse files Browse the repository at this point in the history
Improved click handler behavior. Fixes #233 and #234.
  • Loading branch information
A committed Mar 10, 2015
2 parents fa7d23c + 7f995b2 commit 06cbb85
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@
// Ignore if tag has
// 1. "download" attribute
// 2. rel="external" attribute
if (el.getAttribute('download') || el.getAttribute('rel') === 'external') return;
if (el.hasAttribute('download') || el.getAttribute('rel') === 'external') return;

// ensure non-hash for the same path
var link = el.getAttribute('href');
Expand All @@ -556,10 +556,11 @@
// same page
var orig = path;

path = path.replace(base, '');
if (hashbang) path = path.replace('#!', '');

if (path.indexOf(base) === 0) {
path = path.substr(base.length);
}

if (hashbang) path = path.replace('#!', '');

if (base && orig === path) return;

Expand Down

0 comments on commit 06cbb85

Please sign in to comment.