Add a new column in alter table on key press

This commit is contained in:
Jakub Vrana 2013-07-06 22:49:39 -07:00
parent 6a551c2d73
commit 04a36e9af9
3 changed files with 7 additions and 1 deletions

View 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"); ?>

View 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';

View 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):