Set 'mainaction' class to dialog buttons
This commit is contained in:
parent
f0dd07fa28
commit
6fe1cfcdd2
2 changed files with 45 additions and 14 deletions
|
@ -779,6 +779,9 @@ function rcube_calendar_ui(settings)
|
||||||
resizable: (!bw.ie6 && !bw.ie7), // disable for performance reasons
|
resizable: (!bw.ie6 && !bw.ie7), // disable for performance reasons
|
||||||
closeOnEscape: false,
|
closeOnEscape: false,
|
||||||
title: rcmail.gettext((action == 'edit' ? 'edit_event' : 'new_event'), 'calendar'),
|
title: rcmail.gettext((action == 'edit' ? 'edit_event' : 'new_event'), 'calendar'),
|
||||||
|
open: function() {
|
||||||
|
$dialog.parent().find('.ui-dialog-buttonset .ui-button').first().addClass('mainaction');
|
||||||
|
},
|
||||||
close: function() {
|
close: function() {
|
||||||
editform.hide().appendTo(document.body);
|
editform.hide().appendTo(document.body);
|
||||||
$dialog.dialog("destroy").remove();
|
$dialog.dialog("destroy").remove();
|
||||||
|
@ -1608,10 +1611,15 @@ function rcube_calendar_ui(settings)
|
||||||
$dialog.dialog('destroy').hide();
|
$dialog.dialog('destroy').hide();
|
||||||
},
|
},
|
||||||
buttons: buttons,
|
buttons: buttons,
|
||||||
width: Math.min(1000, $(window).width() - 50),
|
width: 900,
|
||||||
height: 500
|
height: 500
|
||||||
}).show();
|
}).show();
|
||||||
|
|
||||||
|
// define add-button as main action
|
||||||
|
$('.ui-dialog-buttonset .ui-button', $dialog.parent()).first().addClass('mainaction').attr('id', 'rcmbtncalresadd');
|
||||||
|
|
||||||
|
me.dialog_resize($dialog.get(0), 540, Math.min(1000, $(window).width() - 50));
|
||||||
|
|
||||||
// initialize the treelist widget
|
// initialize the treelist widget
|
||||||
if (!resources_treelist) {
|
if (!resources_treelist) {
|
||||||
resources_treelist = new rcube_treelist_widget(rcmail.gui_objects.resourceslist, {
|
resources_treelist = new rcube_treelist_widget(rcmail.gui_objects.resourceslist, {
|
||||||
|
@ -1635,14 +1643,13 @@ function rcube_calendar_ui(settings)
|
||||||
// fetch (all) resource data from server
|
// fetch (all) resource data from server
|
||||||
me.loading_lock = rcmail.set_busy(true, 'loading', me.loading_lock);
|
me.loading_lock = rcmail.set_busy(true, 'loading', me.loading_lock);
|
||||||
rcmail.http_request('resources-list', {}, me.loading_lock);
|
rcmail.http_request('resources-list', {}, me.loading_lock);
|
||||||
|
|
||||||
|
// register button
|
||||||
|
rcmail.register_button('add-resource', 'rcmbtncalresadd', 'uibutton');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
resources_treelist.select('__none__');
|
resources_treelist.select('__none__');
|
||||||
}
|
}
|
||||||
|
|
||||||
// register button
|
|
||||||
$('.ui-dialog-buttonset .ui-button', $dialog.parent()).first().addClass('mainaction').attr('id', 'rcmbtncalresadd');
|
|
||||||
rcmail.register_button('add-resource', 'rcmbtncalresadd', 'input');
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// render the resource details UI box
|
// render the resource details UI box
|
||||||
|
@ -1728,6 +1735,8 @@ function rcube_calendar_ui(settings)
|
||||||
var resource_owner_load = function(data)
|
var resource_owner_load = function(data)
|
||||||
{
|
{
|
||||||
if (data) {
|
if (data) {
|
||||||
|
// TODO: cache this!
|
||||||
|
|
||||||
var table = $(rcmail.gui_objects.resourceownerinfo).find('tbody').html('');
|
var table = $(rcmail.gui_objects.resourceownerinfo).find('tbody').html('');
|
||||||
|
|
||||||
for (var k in data) {
|
for (var k in data) {
|
||||||
|
@ -1899,12 +1908,7 @@ function rcube_calendar_ui(settings)
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
var buttons = [{
|
var buttons = [];
|
||||||
text: rcmail.gettext('cancel', 'calendar'),
|
|
||||||
click: function() {
|
|
||||||
$(this).dialog("close");
|
|
||||||
}
|
|
||||||
}];
|
|
||||||
|
|
||||||
if (!event.recurrence) {
|
if (!event.recurrence) {
|
||||||
buttons.push({
|
buttons.push({
|
||||||
|
@ -1918,12 +1922,22 @@ function rcube_calendar_ui(settings)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
buttons.push({
|
||||||
|
text: rcmail.gettext('cancel', 'calendar'),
|
||||||
|
click: function() {
|
||||||
|
$(this).dialog("close");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
$dialog.dialog({
|
$dialog.dialog({
|
||||||
modal: true,
|
modal: true,
|
||||||
width: 460,
|
width: 460,
|
||||||
dialogClass: 'warning',
|
dialogClass: 'warning',
|
||||||
title: rcmail.gettext((action == 'remove' ? 'removeeventconfirm' : 'changeeventconfirm'), 'calendar'),
|
title: rcmail.gettext((action == 'remove' ? 'removeeventconfirm' : 'changeeventconfirm'), 'calendar'),
|
||||||
buttons: buttons,
|
buttons: buttons,
|
||||||
|
open: function() {
|
||||||
|
$dialog.parent().find('.ui-button').first().focus();
|
||||||
|
},
|
||||||
close: function(){
|
close: function(){
|
||||||
$dialog.dialog("destroy").hide();
|
$dialog.dialog("destroy").hide();
|
||||||
if (!rcmail.busy)
|
if (!rcmail.busy)
|
||||||
|
@ -2156,6 +2170,9 @@ function rcube_calendar_ui(settings)
|
||||||
resizable: true,
|
resizable: true,
|
||||||
closeOnEscape: false,
|
closeOnEscape: false,
|
||||||
title: rcmail.gettext((calendar.id ? 'editcalendar' : 'createcalendar'), 'calendar'),
|
title: rcmail.gettext((calendar.id ? 'editcalendar' : 'createcalendar'), 'calendar'),
|
||||||
|
open: function() {
|
||||||
|
$dialog.parent().find('.ui-dialog-buttonset .ui-button').first().addClass('mainaction');
|
||||||
|
},
|
||||||
close: function() {
|
close: function() {
|
||||||
$dialog.html('').dialog("destroy").hide();
|
$dialog.html('').dialog("destroy").hide();
|
||||||
},
|
},
|
||||||
|
@ -2249,6 +2266,9 @@ function rcube_calendar_ui(settings)
|
||||||
resizable: false,
|
resizable: false,
|
||||||
closeOnEscape: false,
|
closeOnEscape: false,
|
||||||
title: rcmail.gettext('importevents', 'calendar'),
|
title: rcmail.gettext('importevents', 'calendar'),
|
||||||
|
open: function() {
|
||||||
|
$dialog.parent().find('.ui-dialog-buttonset .ui-button').first().addClass('mainaction');
|
||||||
|
},
|
||||||
close: function() {
|
close: function() {
|
||||||
$('.ui-dialog-buttonpane button', $dialog.parent()).button('enable');
|
$('.ui-dialog-buttonpane button', $dialog.parent()).button('enable');
|
||||||
$dialog.dialog("destroy").hide();
|
$dialog.dialog("destroy").hide();
|
||||||
|
@ -2326,6 +2346,9 @@ function rcube_calendar_ui(settings)
|
||||||
resizable: false,
|
resizable: false,
|
||||||
closeOnEscape: false,
|
closeOnEscape: false,
|
||||||
title: rcmail.gettext('exporttitle', 'calendar'),
|
title: rcmail.gettext('exporttitle', 'calendar'),
|
||||||
|
open: function() {
|
||||||
|
$dialog.parent().find('.ui-dialog-buttonset .ui-button').first().addClass('mainaction');
|
||||||
|
},
|
||||||
close: function() {
|
close: function() {
|
||||||
$('.ui-dialog-buttonpane button', $dialog.parent()).button('enable');
|
$('.ui-dialog-buttonpane button', $dialog.parent()).button('enable');
|
||||||
$dialog.dialog("destroy").hide();
|
$dialog.dialog("destroy").hide();
|
||||||
|
|
|
@ -1341,6 +1341,9 @@ function rcube_tasklist_ui(settings)
|
||||||
resizable: (!bw.ie6 && !bw.ie7), // disable for performance reasons
|
resizable: (!bw.ie6 && !bw.ie7), // disable for performance reasons
|
||||||
closeOnEscape: false,
|
closeOnEscape: false,
|
||||||
title: rcmail.gettext((action == 'edit' ? 'edittask' : 'newtask'), 'tasklist'),
|
title: rcmail.gettext((action == 'edit' ? 'edittask' : 'newtask'), 'tasklist'),
|
||||||
|
open: function() {
|
||||||
|
$dialog.parent().find('.ui-dialog-buttonset .ui-button').first().addClass('mainaction');
|
||||||
|
},
|
||||||
close: function() {
|
close: function() {
|
||||||
editform.hide().appendTo(document.body);
|
editform.hide().appendTo(document.body);
|
||||||
$dialog.dialog('destroy').remove();
|
$dialog.dialog('destroy').remove();
|
||||||
|
@ -1664,7 +1667,12 @@ function rcube_tasklist_ui(settings)
|
||||||
resizable: true,
|
resizable: true,
|
||||||
closeOnEscape: false,
|
closeOnEscape: false,
|
||||||
title: rcmail.gettext((list.id ? 'editlist' : 'createlist'), 'tasklist'),
|
title: rcmail.gettext((list.id ? 'editlist' : 'createlist'), 'tasklist'),
|
||||||
close: function() { $dialog.dialog('destroy').hide(); },
|
open: function() {
|
||||||
|
$dialog.parent().find('.ui-dialog-buttonset .ui-button').first().addClass('mainaction');
|
||||||
|
},
|
||||||
|
close: function() {
|
||||||
|
$dialog.dialog('destroy').hide();
|
||||||
|
},
|
||||||
buttons: buttons,
|
buttons: buttons,
|
||||||
minWidth: 400,
|
minWidth: 400,
|
||||||
width: 420
|
width: 420
|
||||||
|
|
Loading…
Add table
Reference in a new issue