From 3093f5815767626f6d5dfa53d3a00ab77f3a3feb Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Thu, 4 Apr 2013 18:32:05 -0700 Subject: [PATCH] Clear column name after resetting search (bug #3601200) --- adminer/include/adminer.inc.php | 2 +- adminer/static/functions.js | 9 +++++++++ changes.txt | 1 + editor/include/adminer.inc.php | 4 ++-- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php index fadc0303..e65f3ad8 100644 --- a/adminer/include/adminer.inc.php +++ b/adminer/include/adminer.inc.php @@ -264,7 +264,7 @@ username.form['auth[driver]'].onchange(); if (!$val || ("$val[col]$val[val]" != "" && in_array($val["op"], $this->operators))) { echo "
"; echo html_select("where[$i][op]", $this->operators, $val["op"], $change_next); - echo "
\n"; + echo "\n"; } } echo "\n"; diff --git a/adminer/static/functions.js b/adminer/static/functions.js index 22064fcb..f0976c9e 100644 --- a/adminer/static/functions.js +++ b/adminer/static/functions.js @@ -255,6 +255,15 @@ function selectAddRow(field) { field.parentNode.parentNode.appendChild(row); } +/** Clear column name after resetting search +* @param HTMLInputElement +*/ +function selectSearch(el) { + if (!el.value) { + el.parentNode.firstChild.selectedIndex = 0; + } +} + /** Toggles column context menu diff --git a/changes.txt b/changes.txt index 85e1cdaa..6a0f8781 100644 --- a/changes.txt +++ b/changes.txt @@ -2,6 +2,7 @@ Adminer 3.6.4-dev: Display pagination on a fixed position Display SQL edit form on Ctrl+click on the select query Recover original view, trigger, routine if creating fails +Clear column name after resetting search (bug #3601200) Allow loading more data with inline edit (bug #3605531) Stay on the same page after deleting rows (bug #3605845) Handle max_input_vars diff --git a/editor/include/adminer.inc.php b/editor/include/adminer.inc.php index b2e9235d..9acc08dc 100644 --- a/editor/include/adminer.inc.php +++ b/editor/include/adminer.inc.php @@ -235,13 +235,13 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5 if (($val["col"] == "" || $columns[$val["col"]]) && "$val[col]$val[val]" != "") { echo "
"; echo html_select("where[$i][op]", array(-1 => "") + $this->operators, $val["op"]); - echo "
\n"; + echo "\n"; $i++; } } echo "
"; echo html_select("where[$i][op]", array(-1 => "") + $this->operators); - echo "
\n"; + echo "\n"; echo "\n"; }