1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-14 02:23:59 +02:00

Clear column name after resetting search (bug #3601200)

This commit is contained in:
Jakub Vrana
2013-04-04 18:32:05 -07:00
parent 1a1b800b40
commit 3093f58157
4 changed files with 13 additions and 3 deletions

View File

@@ -264,7 +264,7 @@ username.form['auth[driver]'].onchange();
if (!$val || ("$val[col]$val[val]" != "" && in_array($val["op"], $this->operators))) {
echo "<div><select name='where[$i][col]' onchange='$change_next'><option value=''>(" . lang('anywhere') . ")" . optionlist($columns, $val["col"], true) . "</select>";
echo html_select("where[$i][op]", $this->operators, $val["op"], $change_next);
echo "<input type='search' name='where[$i][val]' value='" . h($val["val"]) . "' onchange='" . ($val ? "selectFieldChange(this.form)" : "selectAddRow(this)") . ";'></div>\n";
echo "<input type='search' name='where[$i][val]' value='" . h($val["val"]) . "' onchange='" . ($val ? "selectFieldChange(this.form)" : "selectAddRow(this)") . ";' onsearch='selectSearch(this);'></div>\n";
}
}
echo "</div></fieldset>\n";

View File

@@ -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