Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Use `return true` to replace bogus hash

  • Loading branch information...
commit 42b145f7c155b20602a136426f35227ef4675552 1 parent 2113bcb
@jasondavies jasondavies authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/Hash.js
View
6 src/Hash.js
@@ -6,8 +6,7 @@ po.hash = function() {
var parser = function(map, s) {
var args = s.split("/").map(Number);
- if (args.length < 3 || args.some(isNaN))
- move(); // replace bogus hash
+ if (args.length < 3 || args.some(isNaN)) return true; // replace bogus hash
else {
var size = map.size();
map.zoomBy(args[0] - map.zoom(),
@@ -32,7 +31,8 @@ po.hash = function() {
function hashchange() {
if (location.hash === s0) return; // ignore spurious hashchange events
- parser(map, (s0 = location.hash).substring(1));
+ if (parser(map, (s0 = location.hash).substring(1)))
+ move(); // replace bogus hash
}
hash.map = function(x) {
Please sign in to comment.
Something went wrong with that request. Please try again.