Don't hide/show added/dropped columns (bug 1920167)
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@381 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
parent
fb3c74e793
commit
f2813b5741
|
@ -100,10 +100,11 @@ function edit_fields($fields, $collations, $type = "TABLE") {
|
|||
$column_comments = false;
|
||||
foreach ($fields as $i => $field) {
|
||||
$i++;
|
||||
$display = ($_POST["add"][$i-1] || (isset($field["field"]) && !$_POST["drop_col"][$i]));
|
||||
?>
|
||||
<tr>
|
||||
<tr<?php echo ($display ? "" : " style='display: none;'"); ?>>
|
||||
<?php if ($type == "PROCEDURE") { ?><td><select name="fields[<?php echo $i; ?>][inout]"><?php echo optionlist($inout, $field["inout"]); ?></select></td><?php } ?>
|
||||
<th><input name="fields[<?php echo $i; ?>][field]" value="<?php echo ($_POST["drop_col"][$i] ? "" : htmlspecialchars($field["field"])); ?>" maxlength="64" /><input type="hidden" name="fields[<?php echo $i; ?>][orig]" value="<?php echo htmlspecialchars($field[($_POST ? "orig" : "field")]); ?>" /></th>
|
||||
<th><?php if ($display) { ?><input name="fields[<?php echo $i; ?>][field]" value="<?php echo htmlspecialchars($field["field"]); ?>" maxlength="64" /><?php } ?><input type="hidden" name="fields[<?php echo $i; ?>][orig]" value="<?php echo htmlspecialchars($field[($_POST ? "orig" : "field")]); ?>" /></th>
|
||||
<?php edit_type("fields[$i]", $field, $collations); ?>
|
||||
<?php if ($type == "TABLE") { ?>
|
||||
<td><input type="checkbox" name="fields[<?php echo $i; ?>][null]" value="1"<?php if ($field["null"]) { ?> checked="checked"<?php } ?> /></td>
|
||||
|
@ -152,7 +153,8 @@ function add_row(button) {
|
|||
return true;
|
||||
}
|
||||
function remove_row(button) {
|
||||
button.form[button.name.replace(/drop_col(.+)/, 'fields$1[field]')].value = '';
|
||||
var field = button.form[button.name.replace(/drop_col(.+)/, 'fields$1[field]')];
|
||||
field.parentNode.removeChild(field);
|
||||
button.parentNode.parentNode.style.display = 'none';
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue