Permalink
Browse files

Use `return true` to replace bogus hash

  • Loading branch information...
jasondavies committed Dec 9, 2010
1 parent 2113bcb commit 42b145f7c155b20602a136426f35227ef4675552
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/Hash.js
View
@@ -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) {

0 comments on commit 42b145f

Please sign in to comment.