From fa832055c8ef946b16f1cdc25793d4a0a48ad8e5 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Thu, 24 Mar 2011 08:24:57 +0100 Subject: [PATCH] Fix AJAX history after reload --- adminer/static/editing.js | 4 +++- adminer/static/functions.js | 2 ++ changes.txt | 3 +++ editor/static/editing.js | 4 +++- 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/adminer/static/editing.js b/adminer/static/editing.js index 757d8ee2..3280d1ef 100644 --- a/adminer/static/editing.js +++ b/adminer/static/editing.js @@ -4,7 +4,9 @@ * @param string first three characters of database system version */ function bodyLoad(version) { - onpopstate(history); // copied from editor/static/editing.js + if (history.state !== undefined) { // copied from editor/static/editing.js + onpopstate(history); + } 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 f2c76579..45698031 100644 --- a/adminer/static/functions.js +++ b/adminer/static/functions.js @@ -367,6 +367,8 @@ function ajaxSend(url, data, popState) { onpopstate = function (event) { if (event.state ? confirm(areYouSure) : ajaxState) { ajaxSend(location.href, event.state, 1); // 1 - disable pushState + } else { + ajaxState++; } } diff --git a/changes.txt b/changes.txt index c9c477eb..7143ae60 100644 --- a/changes.txt +++ b/changes.txt @@ -1,3 +1,6 @@ +Adminer 3.2.2-dev: +Fix AJAX history after reload + Adminer 3.2.1 (released 2011-03-23): Ability to save expression in edit Respect default database collation (bug #3191489) diff --git a/editor/static/editing.js b/editor/static/editing.js index b58ed71a..39c9af97 100644 --- a/editor/static/editing.js +++ b/editor/static/editing.js @@ -1,5 +1,7 @@ // Editor specific functions function bodyLoad(version) { - onpopstate(history); + if (history.state !== undefined) { + onpopstate(history); + } }