Simplify UI dialog usage
This commit is contained in:
parent
f4531102a2
commit
c65039cf3e
2 changed files with 14 additions and 18 deletions
|
@ -43,11 +43,6 @@ libkolab_audittrail.object_history_dialog = function(p)
|
|||
if ($dialog.is(':ui-dialog'))
|
||||
$dialog.dialog('close');
|
||||
|
||||
var buttons = {};
|
||||
buttons[rcmail.gettext('close')] = function() {
|
||||
$dialog.dialog('close');
|
||||
};
|
||||
|
||||
// hide and reset changelog table
|
||||
$dialog.find('div.notfound-message').remove();
|
||||
$dialog.find('.changelog-table').show().children('tbody')
|
||||
|
@ -61,14 +56,17 @@ libkolab_audittrail.object_history_dialog = function(p)
|
|||
title: p.title,
|
||||
open: function() {
|
||||
$dialog.attr('aria-hidden', 'false');
|
||||
setTimeout(function(){
|
||||
$dialog.parent().find('.ui-dialog-buttonpane .ui-button').first().focus();
|
||||
}, 5);
|
||||
},
|
||||
close: function() {
|
||||
$dialog.dialog('destroy').attr('aria-hidden', 'true').hide();
|
||||
},
|
||||
buttons: buttons,
|
||||
buttons: [
|
||||
{
|
||||
text: rcmail.gettext('close'),
|
||||
click: function() { $dialog.dialog('close'); },
|
||||
autofocus: true
|
||||
}
|
||||
],
|
||||
minWidth: 450,
|
||||
width: 650,
|
||||
height: 350,
|
||||
|
|
|
@ -2227,11 +2227,6 @@ function rcube_tasklist_ui(settings)
|
|||
row.show().data('set', true);
|
||||
});
|
||||
|
||||
var buttons = {};
|
||||
buttons[rcmail.gettext('close')] = function() {
|
||||
$dialog.dialog('close');
|
||||
};
|
||||
|
||||
// open jquery UI dialog
|
||||
$dialog.dialog({
|
||||
modal: false,
|
||||
|
@ -2240,14 +2235,17 @@ function rcube_tasklist_ui(settings)
|
|||
title: rcmail.gettext('objectdiff','tasklist').replace('$rev1', data.rev1).replace('$rev2', data.rev2) + ' - ' + rec.title,
|
||||
open: function() {
|
||||
$dialog.attr('aria-hidden', 'false');
|
||||
setTimeout(function(){
|
||||
$dialog.parent().find('.ui-button:not(.ui-dialog-titlebar-close)').first().focus();
|
||||
}, 5);
|
||||
},
|
||||
close: function() {
|
||||
$dialog.dialog('destroy').attr('aria-hidden', 'true').hide();
|
||||
},
|
||||
buttons: buttons,
|
||||
buttons: [
|
||||
{
|
||||
text: rcmail.gettext('close'),
|
||||
click: function() { $dialog.dialog('close'); },
|
||||
autofocus: true
|
||||
}
|
||||
],
|
||||
minWidth: 320,
|
||||
width: 450
|
||||
}).show();
|
||||
|
|
Loading…
Add table
Reference in a new issue