From fb91af07e0cf04a43777c30a66eef8a0277c57a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laura=20Kl=C3=BCnder?= Date: Tue, 13 Jun 2017 15:39:06 +0200 Subject: [PATCH] dont pushState onpopstate --- src/c3nav/editor/static/editor/js/editor.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/c3nav/editor/static/editor/js/editor.js b/src/c3nav/editor/static/editor/js/editor.js index c55368cd..aab2c1d4 100644 --- a/src/c3nav/editor/static/editor/js/editor.js +++ b/src/c3nav/editor/static/editor/js/editor.js @@ -93,14 +93,12 @@ editor = { editor._sidebar_loaded(); history.replaceState({}, '', location_path); window.onpopstate = function() { - editor.sidebar_get(editor.get_location_path()); + editor.sidebar_get(editor.get_location_path(), true); }; }, - sidebar_get: function(location) { + sidebar_get: function(location, no_push) { // load a new page into the sidebar using a GET request - if ($('#sidebar').find('.content').html() !== '') { - history.pushState({}, '', location); - } + if (!no_push) history.pushState({}, '', location); editor._sidebar_unload(); $.get(location, editor._sidebar_loaded).fail(editor._sidebar_error); },