summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2015-03-31 12:53:02 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2015-03-31 12:53:02 (GMT)
commitc65039cf3e8f00c688d7b3fdc3dc89776ff9dc0f (patch)
tree0c3caec167d84ed675113fcd5717c5ca4d8fa7a1
parentf4531102a27fd76149caa88fc6cb878a3378e001 (diff)
downloadroundcubemail-plugins-kolab-c65039cf3e8f00c688d7b3fdc3dc89776ff9dc0f.tar.gz
Simplify UI dialog usage
-rw-r--r--plugins/libkolab/js/audittrail.js16
-rw-r--r--plugins/tasklist/tasklist.js16
2 files changed, 14 insertions, 18 deletions
diff --git a/plugins/libkolab/js/audittrail.js b/plugins/libkolab/js/audittrail.js
index 56e0df2..42cdbf0 100644
--- a/plugins/libkolab/js/audittrail.js
+++ b/plugins/libkolab/js/audittrail.js
@@ -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,
diff --git a/plugins/tasklist/tasklist.js b/plugins/tasklist/tasklist.js
index d31a26d..42f6707 100644
--- a/plugins/tasklist/tasklist.js
+++ b/plugins/tasklist/tasklist.js
@@ -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();