]> git.joonet.de Git - adminer.git/commitdiff
Add a new column in alter table on key press
authorJakub Vrana <jakub@vrana.cz>
Sun, 7 Jul 2013 05:49:39 +0000 (22:49 -0700)
committerJakub Vrana <jakub@vrana.cz>
Sun, 7 Jul 2013 05:49:39 +0000 (22:49 -0700)
adminer/include/editing.inc.php
adminer/static/editing.js
changes.txt

index a5986dfe5d84bb49e38bb332acb307e1f92ebc80..02107f6de18517826d5a8b746fda5008cbbdaf13 100644 (file)
@@ -244,7 +244,8 @@ 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="<?php echo ($field["field"] != "" || count($fields) > 1 ? "" : "editingAddRow(this); "); ?>editingNameChange(this);" maxlength="64" autocapitalize="off"><?php } ?><input type="hidden" name="fields[<?php echo $i; ?>][orig]" value="<?php echo h($orig); ?>">
+<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 } ?>
+<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") { ?>
 <td><?php echo checkbox("fields[$i][null]", 1, $field["null"], "", "", "block"); ?>
index fafc8cc975bcac66d17c4bb962b1506f85e969ab..10dd68d7c7ce3a1a7974dfe6b1b796abfd9912d6 100644 (file)
@@ -317,11 +317,15 @@ function editingAddRow(button, focus) {
        tags[0].onchange = function () {
                editingNameChange(tags[0]);
        };
+       tags[0].onkeypress = function () {
+       };
        row.parentNode.insertBefore(row2, row.nextSibling);
        if (focus) {
                input.onchange = function () {
                        editingNameChange(input);
                };
+               input.onkeypress = function () {
+               };
                input.focus();
        }
        added += '0';
index b48919fa505bb5845750857a616b377380f1b76e..9560a4418e7864c42226ad11aab76624a49d3874 100644 (file)
@@ -1,5 +1,6 @@
 Adminer 3.7.2-dev:
 Save and continue edit by AJAX
+Add a new column in alter table on key press
 PostgreSQL: Fix handling of nextval() default values
 
 Adminer 3.7.1 (released 2013-06-29):