Allow ajax create-table form only once, autofocus table name input
This commit is contained in:
parent
54cffa0959
commit
f402f308b8
@ -1371,6 +1371,12 @@ function PMA_createTableDialog( $div, url , target)
|
||||
$(this).closest('.ui-dialog-content').dialog('close').remove();
|
||||
};
|
||||
|
||||
// allow create-table form only once
|
||||
if ($('#create_table_form').length) {
|
||||
$('#create_table_form input[autofocus]').focus();
|
||||
return;
|
||||
}
|
||||
|
||||
var $msgbox = PMA_ajaxShowMessage();
|
||||
|
||||
$.get( target , url , function(data) {
|
||||
@ -1431,6 +1437,9 @@ function PMA_createTableDialog( $div, url , target)
|
||||
var $save_button = $('#create_table_form').find("input[name='do_save_data']");
|
||||
$cancel_button.insertAfter($save_button);
|
||||
$button_pane.hide();
|
||||
|
||||
// focus table name input
|
||||
$(this).find("input[autofocus]").focus();
|
||||
},
|
||||
close: function() {
|
||||
$(window).unbind('resize.dialog-resizer');
|
||||
|
||||
@ -563,10 +563,10 @@ echo PMA_generate_common_hidden_inputs($_form_params);
|
||||
unset($_form_params);
|
||||
if ($action == 'tbl_create.php') {
|
||||
?>
|
||||
<table>
|
||||
<table class="table-name">
|
||||
<tr><td><?php echo __('Table name'); ?>: <input type="text" name="table" size="40" maxlength="80"
|
||||
value="<?php echo (isset($_REQUEST['table']) ? htmlspecialchars($_REQUEST['table']) : ''); ?>"
|
||||
class="textfield" />
|
||||
class="textfield" autofocus />
|
||||
</td>
|
||||
<td>
|
||||
<?php if ($action == 'tbl_create.php' || $action == 'tbl_addfield.php') { ?>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user