Fix form submitting with Enter key (Bug #2088)
This commit is contained in:
parent
d6149c398d
commit
7a783f11e6
1 changed files with 13 additions and 0 deletions
|
@ -302,6 +302,9 @@ function kolab_files_folder_create_dialog()
|
|||
height: 400
|
||||
});
|
||||
|
||||
// Fix submitting form with Enter
|
||||
$('form', dialog).submit(kolab_dialog_submit_handler);
|
||||
|
||||
// build parent selector
|
||||
select.append($('<option>').val('').text('---'));
|
||||
$.each(file_api.env.folders, function(i, f) {
|
||||
|
@ -341,6 +344,9 @@ function kolab_files_file_edit_dialog(file)
|
|||
dialog.dialog('destroy').hide();
|
||||
};
|
||||
|
||||
// Fix submitting form with Enter
|
||||
$('form', dialog).submit(kolab_dialog_submit_handler);
|
||||
|
||||
// show dialog window
|
||||
kolab_dialog_show(dialog, {
|
||||
title: rcmail.gettext('kolab_files.fileedit'),
|
||||
|
@ -363,6 +369,13 @@ function kolab_dialog_show(dialog, params)
|
|||
dialog.dialog(params).show();
|
||||
};
|
||||
|
||||
// Handle form submit with Enter key, click first dialog button instead
|
||||
function kolab_dialog_submit_handler()
|
||||
{
|
||||
$(this).parents('.ui-dialog').find('.ui-button').first().click();
|
||||
return false;
|
||||
};
|
||||
|
||||
// smart upload button
|
||||
function kolab_files_upload_input(button)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue