dont pushState onpopstate

This commit is contained in:
Laura Klünder 2017-06-13 15:39:06 +02:00
parent 9fb248d35d
commit fb91af07e0

View file

@ -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);
},