Skip to content

Commit f4f4179

Browse files
committed
Avoid false positive on pathMatch when filtered link.pathname is empty string. Fixes kswedberg#64.
1 parent da9dc97 commit f4f4179

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
{
2-
"name": "jquery.smooth-scroll",
2+
"name": "smooth-scroll",
33
"version": "1.5.0",
4-
"scripts": {
5-
"test": "./node_modules/.bin/grunt"
6-
},
4+
"scripts": {},
75
"main": "jquery.smooth-scroll.js",
86
"author": {
97
"name": "Karl Swedberg",
@@ -36,7 +34,8 @@
3634
"grunt-shell": "~0.2",
3735
"grunt-version": "~0.1.1",
3836
"marked": "^0.3.2",
39-
"node-syntaxhighlighter": "~0.8.1"
37+
"node-syntaxhighlighter": "~0.8.1",
38+
"qunitjs": "^1.15.0"
4039
},
4140
"keywords": [
4241
"jQuery",

src/jquery.smooth-scroll.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ $.fn.extend({
116116
include = true,
117117
clickOpts = {},
118118
hostMatch = ((location.hostname === link.hostname) || !link.hostname),
119-
pathMatch = thisOpts.scrollTarget || ( $.smoothScroll.filterPath(link.pathname) || locationPath ) === locationPath,
119+
pathMatch = thisOpts.scrollTarget || ( $.smoothScroll.filterPath(link.pathname) === locationPath ),
120120
thisHash = escapeSelector(link.hash);
121121

122122
if ( !thisOpts.scrollTarget && (!hostMatch || !pathMatch || !thisHash) ) {

0 commit comments

Comments
 (0)