Focus the first button of UI dialogs

This commit is contained in:
Thomas Bruederli 2012-10-04 16:01:59 +02:00
parent 1b485aded4
commit aa15f1948f
2 changed files with 9 additions and 0 deletions

View file

@ -354,6 +354,9 @@ function rcube_calendar_ui(settings)
resizable: !bw.ie6,
closeOnEscape: (!bw.ie6 && !bw.ie7), // disable for performance reasons
title: Q(me.event_date_text(event)),
open: function() {
$dialog.parent().find('.ui-button').first().focus();
},
close: function() {
$dialog.dialog('destroy').hide();
},
@ -835,6 +838,9 @@ function rcube_calendar_ui(settings)
resizable: true,
closeOnEscape: (!bw.ie6 && !bw.ie7),
title: rcmail.gettext('scheduletime', 'calendar'),
open: function() {
$dialog.parent().find('.ui-dialog-buttonset .ui-button').first().focus();
},
close: function() {
if (bw.ie6)
$("#edit-attendees-table").css('visibility','visible');

View file

@ -902,6 +902,9 @@ function rcube_tasklist_ui(settings)
resizable: true,
closeOnEscape: true,
title: rcmail.gettext('taskdetails', 'tasklist'),
open: function() {
$dialog.parent().find('.ui-button').first().focus();
},
close: function() {
$dialog.dialog('destroy').appendTo(document.body);
},