]> git.joonet.de Git - adminer.git/commitdiff
Add editing row after writing first character
authorJakub Vrana <jakub@vrana.cz>
Wed, 10 Jul 2013 16:02:31 +0000 (09:02 -0700)
committerJakub Vrana <jakub@vrana.cz>
Thu, 11 Jul 2013 18:20:03 +0000 (11:20 -0700)
adminer/include/editing.inc.php
adminer/static/editing.js

index 97dc62d84a206baace319310a42f3224c1608c57..e7280f8d1391744ed7c8733742bf9243efba0b0b 100644 (file)
@@ -244,7 +244,7 @@ function edit_fields($fields, $collations, $type = "TABLE", $foreign_keys = arra
                ?>
 <tr<?php echo ($display ? "" : " style='display: none;'"); ?>>
 <?php echo ($type == "PROCEDURE" ? "<td>" . html_select("fields[$i][inout]", explode("|", $inout), $field["inout"]) : ""); ?>
-<th><?php if ($display) { ?><input name="fields[<?php echo $i; ?>][field]" value="<?php echo h($field["field"]); ?>" onchange="editingNameChange(this);<?php echo ($field["field"] != "" || count($fields) > 1 ? '' : ' editingAddRow(this);" onkeypress="if (this.value) editingAddRow(this);'); ?>" maxlength="64" autocapitalize="off"><?php } ?>
+<th><?php if ($display) { ?><input name="fields[<?php echo $i; ?>][field]" value="<?php echo h($field["field"]); ?>" onchange="editingNameChange(this);<?php echo ($field["field"] != "" || count($fields) > 1 ? '' : ' editingAddRow(this);" onkeyup="if (this.value) editingAddRow(this);'); ?>" maxlength="64" autocapitalize="off"><?php } ?>
 <input type="hidden" name="fields[<?php echo $i; ?>][orig]" value="<?php echo h($orig); ?>">
 <?php edit_type("fields[$i]", $field, $collations, $foreign_keys); ?>
 <?php if ($type == "TABLE") { ?>
index 17ff18937c3bf0f3c9fce19e02f5ff4659bbecc9..ca7742b546d3c67a0b3eb9d33ff94887f68a6902 100644 (file)
@@ -317,14 +317,14 @@ function editingAddRow(button, focus) {
        tags[0].onchange = function () {
                editingNameChange(tags[0]);
        };
-       tags[0].onkeypress = function () {
+       tags[0].onkeyup = function () {
        };
        row.parentNode.insertBefore(row2, row.nextSibling);
        if (focus) {
                input.onchange = function () {
                        editingNameChange(input);
                };
-               input.onkeypress = function () {
+               input.onkeyup = function () {
                };
                input.focus();
        }