]> git.joonet.de Git - adminer.git/commitdiff
Return false from editingMoveRow()
authorJakub Vrana <jakub@vrana.cz>
Fri, 12 Jan 2018 21:29:11 +0000 (22:29 +0100)
committerJakub Vrana <jakub@vrana.cz>
Fri, 12 Jan 2018 21:35:05 +0000 (22:35 +0100)
adminer/include/editing.inc.php
adminer/static/editing.js

index 9f27dd400497b086e9ebb99bb1d785d1547b3782..8ce21633b2a9ef3ea5f89e62488fea3beb9e39a6 100644 (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";
index 4e979ba8a5b89bc989fd7c160a45059bf2d0754d..b0cbb5172f583ddf37d15baf90d0a71a012a597e 100644 (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 = '';