projects
/
rails.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
be56eb5
)
Don't set state if it doesn't exist
author
John Firebaugh
<john.firebaugh@gmail.com>
Thu, 14 Nov 2013 00:01:54 +0000
(16:01 -0800)
committer
John Firebaugh
<john.firebaugh@gmail.com>
Thu, 14 Nov 2013 00:01:54 +0000
(16:01 -0800)
app/assets/javascripts/router.js
patch
|
blob
|
history
diff --git
a/app/assets/javascripts/router.js
b/app/assets/javascripts/router.js
index fbad1e28c1695f90d37b5a40bef573f491e1afd1..5b9cdad07141515c883065671bef73c602a8ea06 100644
(file)
--- a/
app/assets/javascripts/router.js
+++ b/
app/assets/javascripts/router.js
@@
-88,8
+88,10
@@
OSM.Router = function(map, rts) {
currentRoute = routes.recognize(currentPath);
currentRoute.run('popstate', currentPath);
var state = e.originalEvent.state;
- map.setView(state.center, state.zoom, {animate: false});
- map.updateLayers(state.layers);
+ if (state.center) {
+ map.setView(state.center, state.zoom, {animate: false});
+ map.updateLayers(state.layers);
+ }
});
return function (url) {