]> git.0d.be Git - panikweb.git/commitdiff
do not pushstate when going back in history
authorFrédéric Péters <fpeters@0d.be>
Fri, 27 Sep 2013 21:56:46 +0000 (23:56 +0200)
committerFrédéric Péters <fpeters@0d.be>
Fri, 27 Sep 2013 21:56:46 +0000 (23:56 +0200)
panikweb_templates/static/js/specifics.js

index 71098ed1fc310e231ba250b571ceacb992b53dc2..03fe8943acd7b7cd4dae00e8678b5a18d694ec62 100644 (file)
@@ -95,11 +95,13 @@ $(function() {
        };
 
        $(window).on("popstate", function(e) {
-               if (e.originalEvent.state !== null) {loadPage(location.href);}
+               if (e.originalEvent.state !== null) {loadPage(location.href, false);}
        });
 
-       loadPage = function(href) {
-               history.pushState({}, '', href);
+       loadPage = function(href, push_state) {
+               if (push_state !== false) {
+                       history.pushState({}, '', href);
+               }
                if (loadPage_request !== null) {
                        loadPage_request.abort();
                }