Return false from editingMoveRow()

This commit is contained in:
Jakub Vrana 2018-01-12 22:29:11 +01:00
parent 2eaac2e94e
commit af1ad47a64
2 changed files with 8 additions and 8 deletions

View file

@ -279,9 +279,9 @@ echo checkbox("fields[$i][has_default]", 1, $field["has_default"], "", "", "", "
<?php
echo "<td>";
echo (support("move_col") ?
"<input type='image' class='icon' name='add[$i]' src='../adminer/static/plus.gif' alt='+' title='" . lang('Add next') . "' onclick='return !editingAddRow.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='add[$i]' src='../adminer/static/plus.gif' alt='+' title='" . lang('Add next') . "' onclick='return editingAddRow.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;"
: "");
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";

View file

@ -211,7 +211,7 @@ function editingNameChange() {
/** Add table row for next field
* @param boolean
* @return boolean
* @return boolean false
* @this HTMLInputElement
*/
function editingAddRow(focus) {
@ -249,7 +249,7 @@ function editingAddRow(focus) {
}
added += '0';
rowCount++;
return true;
return false;
}
/** Remove table row for field
@ -266,18 +266,18 @@ function editingRemoveRow(name) {
/** Move table row for field
* @param boolean direction to move row, true for up or false for down
* @return boolean
* @return boolean false for success
* @this HTMLInputElement
*/
function editingMoveRow(dir){
var row = parentTag(this, 'tr');
if (!('nextElementSibling' in row)) {
return false;
return true;
}
row.parentNode.insertBefore(row, dir
? row.previousElementSibling
: row.nextElementSibling ? row.nextElementSibling.nextElementSibling : row.parentNode.firstChild);
return true;
return false;
}
var lastType = '';