diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php index 55711c0c..8dbc44fb 100644 --- a/adminer/include/adminer.inc.php +++ b/adminer/include/adminer.inc.php @@ -315,7 +315,7 @@ focus(qs('#username')); $select[""] = array(); foreach ($select as $key => $val) { $val = $_GET["columns"][$key]; - $column = select_input(" name='columns[$i][col]' onchange='" . ($key !== "" ? "selectFieldChange(this.form)" : "selectAddRow.call(this)") . ";'", $columns, $val["col"]); + $column = select_input(" name='columns[$i][col]' onchange='" . ($key !== "" ? "selectFieldChange" : "selectAddRow") . ".call(this);'", $columns, $val["col"]); echo "
" . ($functions || $grouping ? "" . "($column)" : $column) . "
\n"; @@ -335,7 +335,7 @@ focus(qs('#username')); foreach ($indexes as $i => $index) { if ($index["type"] == "FULLTEXT") { echo "(" . implode(", ", array_map('h', $index["columns"])) . ") AGAINST"; - echo " "; + echo " "; echo checkbox("boolean[$i]", 1, isset($_GET["boolean"][$i]), "BOOL"); echo "
\n"; } @@ -348,7 +348,7 @@ focus(qs('#username')); if (!$val || ("$val[col]$val[val]" != "" && in_array($val["op"], $this->operators))) { echo "
" . select_input(" name='where[$i][col]' onchange='$change_next'", $columns, $val["col"], "", "(" . lang('anywhere') . ")"); echo html_select("where[$i][op]", $this->operators, $val["op"], $change_next); - echo "
\n"; + echo "\n"; } } echo "\n"; @@ -365,7 +365,7 @@ focus(qs('#username')); $i = 0; foreach ((array) $_GET["order"] as $key => $val) { if ($val != "") { - echo "
" . select_input(" name='order[$i]' onchange='selectFieldChange(this.form);'", $columns, $val); + echo "
" . select_input(" name='order[$i]' onchange='selectFieldChange.call(this);'", $columns, $val); echo checkbox("desc[$i]", 1, isset($_GET["desc"][$key]), lang('descending')) . "
\n"; $i++; } @@ -381,7 +381,7 @@ focus(qs('#username')); */ function selectLimitPrint($limit) { echo "
" . lang('Limit') . "
"; //
for easy styling - echo ""; + echo ""; echo "
\n"; } @@ -419,7 +419,7 @@ focus(qs('#username')); json_row($key); } echo ";\n"; - echo "selectFieldChange(qs('#form'));\n"; + echo "selectFieldChange.call(qs('#form')['select']);\n"; echo "\n"; echo "
\n"; } diff --git a/adminer/static/editing.js b/adminer/static/editing.js index 3db7820f..1b46a64f 100644 --- a/adminer/static/editing.js +++ b/adminer/static/editing.js @@ -94,9 +94,10 @@ function dbChange() { /** Check whether the query will be executed with index -* @param HTMLFormElement +* @this HTMLElement */ -function selectFieldChange(form) { +function selectFieldChange() { + var form = this.form; var ok = (function () { var inputs = qsa('input', form); for (var i=0; i < inputs.length; i++) { diff --git a/adminer/static/functions.js b/adminer/static/functions.js index c1d9401b..1b489262 100644 --- a/adminer/static/functions.js +++ b/adminer/static/functions.js @@ -357,9 +357,7 @@ function menuOut() { */ function selectAddRow() { var field = this; - field.onchange = function () { - selectFieldChange(field.form); - }; + field.onchange = selectFieldChange; field.onchange(); var row = cloneNode(field.parentNode); var selects = qsa('select', row);