local-links
Advanced tools
Comparing version 1.0.5 to 1.0.6
@@ -79,3 +79,5 @@ function isHTMLElement(obj) { | ||
// then ignore it because we werent looking for hash links | ||
return inPageHash ? null : aPathname; | ||
return inPageHash ? | ||
null : | ||
aPathname + (anchor.search || '') + (aHash || ''); | ||
} | ||
@@ -82,0 +84,0 @@ } |
{ | ||
"name": "local-links", | ||
"description": "Determine cross-browser if an event or anchor element should be handled locally.", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"author": "Luke Karrys <luke@lukekarrys.com>", | ||
@@ -6,0 +6,0 @@ "bugs": { |
@@ -21,2 +21,3 @@ var test = require('tape'); | ||
'<a id="local2" href="/local/page/1">Local2</a>', | ||
'<a id="local-search" href="/local/page/1?param=2">Search</a>', | ||
'<a id="relative" href="page-2">Relative</a>', | ||
@@ -27,2 +28,3 @@ '<a id="global" href="http://google.com/page/number/1">Global</a>', | ||
'<a id="in-page-hash" href="#modal">Hash</a>', | ||
'<a id="out-of-page-hash" href="/local/page/1#two">Out of Page hash</a>', | ||
'<a id="global-hash" href="http://google.com/#hash">Global Hash</a>', | ||
@@ -64,2 +66,4 @@ '<a id="active" href="/">Active</a>', | ||
var a = $('local'); | ||
var search = $('local-search'); | ||
var outHash = $('out-of-page-hash'); | ||
var span = $('local-nested'); | ||
@@ -70,6 +74,8 @@ var global = $('global'); | ||
t.plan(5); | ||
t.plan(7); | ||
t.equal(localLinks.pathname(a), '/local/page/1'); | ||
t.equal(localLinks.pathname(span), '/local/page/1'); | ||
t.equal(localLinks.pathname(search), '/local/page/1?param=2'); | ||
t.equal(localLinks.pathname(outHash), '/local/page/1#two'); | ||
t.equal(localLinks.pathname(global), null); | ||
@@ -76,0 +82,0 @@ t.equal(localLinks.pathname(relative), '/page-2'); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17686
306