From cdeecc3e19a2b207633266e14ae6bb8c50a19501 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Thu, 17 Mar 2011 23:48:38 +0100 Subject: [PATCH] Avoid double AJAX refresh in Chrome --- adminer/static/editing.js | 4 +--- adminer/static/functions.js | 2 +- editor/static/editing.js | 4 +--- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/adminer/static/editing.js b/adminer/static/editing.js index aad7cf03..757d8ee2 100644 --- a/adminer/static/editing.js +++ b/adminer/static/editing.js @@ -4,9 +4,7 @@ * @param string first three characters of database system version */ function bodyLoad(version) { - if (history.state) { // copied from editor/static/editing.js - onpopstate(history); - } + onpopstate(history); // copied from editor/static/editing.js var jushRoot = '../externals/jush/'; var script = document.createElement('script'); script.src = jushRoot + 'jush.js'; diff --git a/adminer/static/functions.js b/adminer/static/functions.js index 963224d9..6cf09ebc 100644 --- a/adminer/static/functions.js +++ b/adminer/static/functions.js @@ -346,7 +346,7 @@ function ajaxSend(url, data, popState) { * @param PopStateEvent|history */ onpopstate = function (event) { - if (!event.state || confirm(areYouSure)) { + if (event.state ? confirm(areYouSure) : ajaxState) { ajaxSend(location.href, event.state, 1); // 1 - disable pushState } } diff --git a/editor/static/editing.js b/editor/static/editing.js index 47fc8e72..b58ed71a 100644 --- a/editor/static/editing.js +++ b/editor/static/editing.js @@ -1,7 +1,5 @@ // Editor specific functions function bodyLoad(version) { - if (history.state) { - onpopstate(history); - } + onpopstate(history); } -- 2.39.5