Return false from editingRemoveRow

This commit is contained in:
Jakub Vrana 2018-01-12 16:06:00 +01:00
parent efcf37d162
commit 068ee71bf7
3 changed files with 4 additions and 4 deletions

View file

@ -280,7 +280,7 @@ echo checkbox("fields[$i][has_default]", 1, $field["has_default"], "", "", "", "
. "<input type='image' class='icon' name='up[$i]' src='../adminer/static/up.gif' alt='^' title='" . lang('Move up') . "' onclick='return !editingMoveRow.call(this, 1);'>&nbsp;" . "<input type='image' class='icon' name='up[$i]' src='../adminer/static/up.gif' alt='^' title='" . lang('Move up') . "' onclick='return !editingMoveRow.call(this, 1);'>&nbsp;"
. "<input type='image' class='icon' name='down[$i]' src='../adminer/static/down.gif' alt='v' title='" . lang('Move down') . "' onclick='return !editingMoveRow.call(this, 0);'>&nbsp;" . "<input type='image' class='icon' name='down[$i]' src='../adminer/static/down.gif' alt='v' title='" . lang('Move down') . "' onclick='return !editingMoveRow.call(this, 0);'>&nbsp;"
: ""); : "");
echo ($orig == "" || support("drop_col") ? "<input type='image' class='icon' name='drop_col[$i]' src='../adminer/static/cross.gif' alt='x' title='" . lang('Remove') . "' onclick=\"return !editingRemoveRow.call(this, 'fields\$1[field]');\">" : ""); echo ($orig == "" || support("drop_col") ? "<input type='image' class='icon' name='drop_col[$i]' src='../adminer/static/cross.gif' alt='x' title='" . lang('Remove') . "' onclick=\"return editingRemoveRow.call(this, 'fields\$1[field]');\">" : "");
echo "\n"; echo "\n";
} }
} }

View file

@ -132,7 +132,7 @@ foreach ($row["indexes"] as $index) {
} }
echo "<td><input name='indexes[$j][name]' value='" . h($index["name"]) . "' autocapitalize='off' aria-labelledby='label-name'>\n"; echo "<td><input name='indexes[$j][name]' value='" . h($index["name"]) . "' autocapitalize='off' aria-labelledby='label-name'>\n";
echo "<td><input type='image' class='icon' name='drop_col[$j]' src='../adminer/static/cross.gif' alt='x' title='" . lang('Remove') . "' onclick=\"return !editingRemoveRow.call(this, 'indexes\$1[type]');\">\n"; echo "<td><input type='image' class='icon' name='drop_col[$j]' src='../adminer/static/cross.gif' alt='x' title='" . lang('Remove') . "' onclick=\"return editingRemoveRow.call(this, 'indexes\$1[type]');\">\n";
} }
$j++; $j++;
} }

View file

@ -258,14 +258,14 @@ function editingAddRow(focus) {
/** Remove table row for field /** Remove table row for field
* @param string * @param string
* @return boolean * @return boolean false
* @this HTMLInputElement * @this HTMLInputElement
*/ */
function editingRemoveRow(name) { function editingRemoveRow(name) {
var field = formField(this.form, this.name.replace(/[^\[]+(.+)/, name)); var field = formField(this.form, this.name.replace(/[^\[]+(.+)/, name));
field.parentNode.removeChild(field); field.parentNode.removeChild(field);
parentTag(this, 'tr').style.display = 'none'; parentTag(this, 'tr').style.display = 'none';
return true; return false;
} }
/** Move table row for field /** Move table row for field