]> git.openstreetmap.org Git - rails.git/commitdiff
Restore previous map state on popstate
authorJohn Firebaugh <john.firebaugh@gmail.com>
Tue, 8 Oct 2013 22:54:07 +0000 (15:54 -0700)
committerJohn Firebaugh <john.firebaugh@gmail.com>
Sun, 13 Oct 2013 21:46:09 +0000 (14:46 -0700)
app/assets/javascripts/index.js

index 59335ff849e60d3d08e2c93d14f967558bd3b4e6..11523df3940f5fbdc5a1b8fea3c12f91d8433bcb 100644 (file)
@@ -24,6 +24,10 @@ $(document).ready(function () {
 
   map.hash = L.hash(map);
 
+  $(window).on('popstate', function() {
+    map.hash.update();
+  });
+
   var copyright = I18n.t('javascripts.map.copyright', {copyright_url: '/copyright'});
 
   var layers = [