[adminer-svn] SF.net SVN: adminer:[1145] trunk/adminer
Database management in a single PHP file
Brought to you by:
jakubvrana
From: <jak...@us...> - 2009-09-25 09:52:36
|
Revision: 1145 http://adminer.svn.sourceforge.net/adminer/?rev=1145&view=rev Author: jakubvrana Date: 2009-09-25 09:52:24 +0000 (Fri, 25 Sep 2009) Log Message: ----------- Don't remove onchange after click on add Modified Paths: -------------- trunk/adminer/include/editing.inc.php trunk/adminer/static/editing.js Modified: trunk/adminer/include/editing.inc.php =================================================================== --- trunk/adminer/include/editing.inc.php 2009-09-25 09:01:28 UTC (rev 1144) +++ trunk/adminer/include/editing.inc.php 2009-09-25 09:52:24 UTC (rev 1145) @@ -182,7 +182,7 @@ <td<?php echo ($column_comments ? "" : " class='hidden'"); ?>><input name="fields[<?php echo $i; ?>][comment]" value="<?php echo h($field["comment"]); ?>" maxlength="255"> <?php } ?> <?php - echo "<td class='nowrap'><input type='image' name='add[$i]' src='../adminer/static/plus.gif' alt='+' title='" . lang('Add next') . "' onclick='var x = editing_add_row(this, $allowed); if (x) { x.focus(); x.onchange = function () { }; } return !x;'>"; + echo "<td class='nowrap'><input type='image' name='add[$i]' src='../adminer/static/plus.gif' alt='+' title='" . lang('Add next') . "' onclick='return !editing_add_row(this, $allowed, 1);'>"; echo " <input type='image' name='drop_col[$i]' src='../adminer/static/cross.gif' alt='x' title='" . lang('Remove') . "' onclick='return !editing_remove_row(this);'>"; echo " <input type='image' name='up[$i]' src='../adminer/static/up.gif' alt='^' title='" . lang('Move up') . "'>"; echo " <input type='image' name='down[$i]' src='../adminer/static/down.gif' alt='v' title='" . lang('Move down') . "'>"; Modified: trunk/adminer/static/editing.js =================================================================== --- trunk/adminer/static/editing.js 2009-09-25 09:01:28 UTC (rev 1144) +++ trunk/adminer/static/editing.js 2009-09-25 09:52:24 UTC (rev 1145) @@ -91,7 +91,7 @@ } } -function editing_add_row(button, allowed) { +function editing_add_row(button, allowed, focus) { if (allowed && row_count >= allowed) { return false; } @@ -107,7 +107,7 @@ } tags = row.getElementsByTagName('input'); tags2 = row2.getElementsByTagName('input'); - var ret = tags2[0]; // IE loose tags2 after insertBefore() + var input = tags2[0]; // IE loose tags2 after insertBefore() for (var i=0; i < tags.length; i++) { if (tags[i].name == 'auto_increment_col') { tags2[i].value = x; @@ -125,9 +125,15 @@ editing_name_change(tags[0]); }; row.parentNode.insertBefore(row2, row.nextSibling); + if (focus) { + input.onchange = function () { + editing_name_change(input); + }; + input.focus(); + } added += '0'; row_count++; - return ret; + return true; } function editing_remove_row(button) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |