Return false from editingMoveRow()
This commit is contained in:
parent
2eaac2e94e
commit
af1ad47a64
|
@ -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);'> "
|
||||
. "<input type='image' class='icon' name='up[$i]' src='../adminer/static/up.gif' alt='^' title='" . lang('Move up') . "' onclick='return !editingMoveRow.call(this, 1);'> "
|
||||
. "<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);'> "
|
||||
"<input type='image' class='icon' name='add[$i]' src='../adminer/static/plus.gif' alt='+' title='" . lang('Add next') . "' onclick='return editingAddRow.call(this, 1);'> "
|
||||
. "<input type='image' class='icon' name='up[$i]' src='../adminer/static/up.gif' alt='^' title='" . lang('Move up') . "' onclick='return editingMoveRow.call(this, 1);'> "
|
||||
. "<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);'> "
|
||||
: "");
|
||||
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";
|
||||
|
|
|
@ -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 = '';
|
||||
|
|
Loading…
Reference in a new issue