Skip to content

Commit

Permalink
Merge pull request #226 from s7anley/master
Browse files Browse the repository at this point in the history
use Object.toString() instead of window.toString()
  • Loading branch information
sorich87 committed Mar 20, 2014
2 parents c6e12ab + 73532cf commit 9cb34a1
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion build/js/bootstrap-tour-standalone.js
Expand Up @@ -931,7 +931,7 @@
};

Tour.prototype._isRedirect = function(path, currentPath) {
return (path != null) && path !== "" && ((toString.call(path) === "[object RegExp]" && !path.test(currentPath)) || (toString.call(path) === "[object String]" && path.replace(/\?.*$/, "").replace(/\/?$/, "") !== currentPath.replace(/\/?$/, "")));
return (path != null) && path !== "" && (({}.toString.call(path) === "[object RegExp]" && !path.test(currentPath)) || ({}.toString.call(path) === "[object String]" && path.replace(/\?.*$/, "").replace(/\/?$/, "") !== currentPath.replace(/\/?$/, "")));
};

Tour.prototype._redirect = function(step, path) {
Expand Down
2 changes: 1 addition & 1 deletion build/js/bootstrap-tour-standalone.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/js/bootstrap-tour.js
Expand Up @@ -420,7 +420,7 @@
};

Tour.prototype._isRedirect = function(path, currentPath) {
return (path != null) && path !== "" && ((toString.call(path) === "[object RegExp]" && !path.test(currentPath)) || (toString.call(path) === "[object String]" && path.replace(/\?.*$/, "").replace(/\/?$/, "") !== currentPath.replace(/\/?$/, "")));
return (path != null) && path !== "" && (({}.toString.call(path) === "[object RegExp]" && !path.test(currentPath)) || ({}.toString.call(path) === "[object String]" && path.replace(/\?.*$/, "").replace(/\/?$/, "") !== currentPath.replace(/\/?$/, "")));
};

Tour.prototype._redirect = function(step, path) {
Expand Down
2 changes: 1 addition & 1 deletion build/js/bootstrap-tour.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/assets/js/bootstrap-tour.js
Expand Up @@ -420,7 +420,7 @@
};

Tour.prototype._isRedirect = function(path, currentPath) {
return (path != null) && path !== "" && ((toString.call(path) === "[object RegExp]" && !path.test(currentPath)) || (toString.call(path) === "[object String]" && path.replace(/\?.*$/, "").replace(/\/?$/, "") !== currentPath.replace(/\/?$/, "")));
return (path != null) && path !== "" && (({}.toString.call(path) === "[object RegExp]" && !path.test(currentPath)) || ({}.toString.call(path) === "[object String]" && path.replace(/\?.*$/, "").replace(/\/?$/, "") !== currentPath.replace(/\/?$/, "")));
};

Tour.prototype._redirect = function(step, path) {
Expand Down
4 changes: 2 additions & 2 deletions src/coffee/bootstrap-tour.coffee
Expand Up @@ -342,8 +342,8 @@
# Check if step path equals current document path
_isRedirect: (path, currentPath) ->
path? and path isnt "" and (
(toString.call(path) is "[object RegExp]" and not path.test currentPath) or
(toString.call(path) is "[object String]" and
(({}).toString.call(path) is "[object RegExp]" and not path.test currentPath) or
(({}).toString.call(path) is "[object String]" and
path.replace(/\?.*$/, "").replace(/\/?$/, "") isnt currentPath.replace(/\/?$/, ""))
)

Expand Down

0 comments on commit 9cb34a1

Please sign in to comment.