Get rid of jQuery-UI button use
This commit is contained in:
parent
7ed760cda0
commit
b5bde340c2
2 changed files with 20 additions and 23 deletions
|
@ -1279,9 +1279,7 @@ function rcube_calendar_ui(settings)
|
||||||
});
|
});
|
||||||
|
|
||||||
// enable/disable buttons
|
// enable/disable buttons
|
||||||
// FIXME: .button() does nothing in Elastic skin
|
$('#schedule-find-prev').prop('disabled', fb_start.getTime() < now.getTime());
|
||||||
var disabled = fb_start.getTime() < now.getTime();
|
|
||||||
$('#schedule-find-prev').button('option', 'disabled', disabled).prop('disabled', disabled);
|
|
||||||
|
|
||||||
// dialog buttons
|
// dialog buttons
|
||||||
var buttons = [
|
var buttons = [
|
||||||
|
@ -1829,7 +1827,8 @@ function rcube_calendar_ui(settings)
|
||||||
// move freebusy grid if necessary
|
// move freebusy grid if necessary
|
||||||
var event_start = 'toDate' in event.start ? event.start.toDate() : event.start,
|
var event_start = 'toDate' in event.start ? event.start.toDate() : event.start,
|
||||||
event_end = 'toDate' in event.end ? event.end.toDate() : event.end,
|
event_end = 'toDate' in event.end ? event.end.toDate() : event.end,
|
||||||
offset = Math.ceil((event_start.getTime() - freebusy_ui.end.getTime()) / DAY_MS);
|
offset = Math.ceil((event_start.getTime() - freebusy_ui.end.getTime()) / DAY_MS),
|
||||||
|
now = new Date();
|
||||||
|
|
||||||
if (event_start.getTime() >= freebusy_ui.end.getTime())
|
if (event_start.getTime() >= freebusy_ui.end.getTime())
|
||||||
render_freebusy_grid(Math.max(1, offset));
|
render_freebusy_grid(Math.max(1, offset));
|
||||||
|
@ -1838,9 +1837,7 @@ function rcube_calendar_ui(settings)
|
||||||
else
|
else
|
||||||
render_freebusy_overlay();
|
render_freebusy_overlay();
|
||||||
|
|
||||||
var now = new Date(), disabled = event_start.getTime() < now.getTime();
|
$('#schedule-find-prev').prop('disabled', event_start.getTime() < now.getTime());
|
||||||
// FIXME: .button() does nothing in Elastic skin
|
|
||||||
$('#schedule-find-prev').button('option', 'disabled', disabled).prop('disabled', disabled);
|
|
||||||
|
|
||||||
// speak new selection
|
// speak new selection
|
||||||
rcmail.display_message(rcmail.gettext('suggestedslot', 'calendar') + ': ' + me.event_date_text(event, true), 'voice');
|
rcmail.display_message(rcmail.gettext('suggestedslot', 'calendar') + ': ' + me.event_date_text(event, true), 'voice');
|
||||||
|
@ -2647,7 +2644,7 @@ function rcube_calendar_ui(settings)
|
||||||
if (html) {
|
if (html) {
|
||||||
var $dialog = $('<div>').html(html);
|
var $dialog = $('<div>').html(html);
|
||||||
|
|
||||||
$dialog.find('a.button').button().filter(':not(.disabled)').click(function(e) {
|
$dialog.find('a.button').filter(':not(.disabled)').click(function(e) {
|
||||||
data._savemode = String(this.href).replace(/.+#/, '');
|
data._savemode = String(this.href).replace(/.+#/, '');
|
||||||
|
|
||||||
// open event edit dialog when saving as new
|
// open event edit dialog when saving as new
|
||||||
|
@ -3016,7 +3013,7 @@ function rcube_calendar_ui(settings)
|
||||||
if (form && form.elements._data.value) {
|
if (form && form.elements._data.value) {
|
||||||
rcmail.async_upload_form(form, 'import_events', function(e) {
|
rcmail.async_upload_form(form, 'import_events', function(e) {
|
||||||
rcmail.set_busy(false, null, me.saving_lock);
|
rcmail.set_busy(false, null, me.saving_lock);
|
||||||
$('.ui-dialog-buttonpane button', $dialog.parent()).button('enable');
|
$('.ui-dialog-buttonpane button', $dialog.parent()).prop('disabled', false);
|
||||||
|
|
||||||
// display error message if no sophisticated response from server arrived (e.g. iframe load error)
|
// display error message if no sophisticated response from server arrived (e.g. iframe load error)
|
||||||
if (me.import_succeeded === null)
|
if (me.import_succeeded === null)
|
||||||
|
@ -3028,7 +3025,7 @@ function rcube_calendar_ui(settings)
|
||||||
rcmail.env.request_timeout = 600;
|
rcmail.env.request_timeout = 600;
|
||||||
me.import_succeeded = null;
|
me.import_succeeded = null;
|
||||||
me.saving_lock = rcmail.set_busy(true, 'uploading');
|
me.saving_lock = rcmail.set_busy(true, 'uploading');
|
||||||
$('.ui-dialog-buttonpane button', $dialog.parent()).button('disable');
|
$('.ui-dialog-buttonpane button', $dialog.parent()).prop('disabled', true);
|
||||||
|
|
||||||
// restore settings
|
// restore settings
|
||||||
rcmail.env.request_timeout = timeout;
|
rcmail.env.request_timeout = timeout;
|
||||||
|
@ -3049,7 +3046,7 @@ function rcube_calendar_ui(settings)
|
||||||
closeOnEscape: false,
|
closeOnEscape: false,
|
||||||
title: rcmail.gettext('importevents', 'calendar'),
|
title: rcmail.gettext('importevents', 'calendar'),
|
||||||
close: function() {
|
close: function() {
|
||||||
$('.ui-dialog-buttonpane button', $dialog.parent()).button('enable');
|
$('.ui-dialog-buttonpane button', $dialog.parent()).prop('disabled', false);
|
||||||
$dialog.dialog("destroy").hide();
|
$dialog.dialog("destroy").hide();
|
||||||
},
|
},
|
||||||
buttons: buttons,
|
buttons: buttons,
|
||||||
|
@ -3132,7 +3129,7 @@ function rcube_calendar_ui(settings)
|
||||||
closeOnEscape: false,
|
closeOnEscape: false,
|
||||||
title: rcmail.gettext('exporttitle', 'calendar'),
|
title: rcmail.gettext('exporttitle', 'calendar'),
|
||||||
close: function() {
|
close: function() {
|
||||||
$('.ui-dialog-buttonpane button', $dialog.parent()).button('enable');
|
$('.ui-dialog-buttonpane button', $dialog.parent()).prop('disabled', false);
|
||||||
$dialog.dialog("destroy").hide();
|
$dialog.dialog("destroy").hide();
|
||||||
},
|
},
|
||||||
buttons: buttons,
|
buttons: buttons,
|
||||||
|
@ -4053,11 +4050,11 @@ function rcube_calendar_ui(settings)
|
||||||
event_freebusy_dialog();
|
event_freebusy_dialog();
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#schedule-freebusy-prev').html('◄').button().click(function(){ render_freebusy_grid(-1); });
|
$('#schedule-freebusy-prev').html('◄').click(function() { render_freebusy_grid(-1); });
|
||||||
$('#schedule-freebusy-next').html('►').button().click(function(){ render_freebusy_grid(1); }); // FIXME .parent().buttonset();
|
$('#schedule-freebusy-next').html('►').click(function() { render_freebusy_grid(1); });
|
||||||
|
|
||||||
$('#schedule-find-prev').button().click(function(){ freebusy_find_slot(-1); });
|
$('#schedule-find-prev').click(function() { freebusy_find_slot(-1); });
|
||||||
$('#schedule-find-next').button().click(function(){ freebusy_find_slot(1); });
|
$('#schedule-find-next').click(function() { freebusy_find_slot(1); });
|
||||||
|
|
||||||
$('#schedule-freebusy-workinghours').click(function(){
|
$('#schedule-freebusy-workinghours').click(function(){
|
||||||
freebusy_ui.workinhoursonly = this.checked;
|
freebusy_ui.workinhoursonly = this.checked;
|
||||||
|
|
|
@ -893,7 +893,7 @@ function rcube_tasklist_ui(settings)
|
||||||
rcmail.async_upload_form(form, 'import', function(e) {
|
rcmail.async_upload_form(form, 'import', function(e) {
|
||||||
rcmail.set_busy(false, null, saving_lock);
|
rcmail.set_busy(false, null, saving_lock);
|
||||||
saving_lock = null;
|
saving_lock = null;
|
||||||
$('.ui-dialog-buttonpane button', $dialog.parent()).button('enable');
|
$('.ui-dialog-buttonpane button', $dialog.parent()).prop('disabled', false);
|
||||||
|
|
||||||
// display error message if no sophisticated response from server arrived (e.g. iframe load error)
|
// display error message if no sophisticated response from server arrived (e.g. iframe load error)
|
||||||
if (me.import_succeeded === null)
|
if (me.import_succeeded === null)
|
||||||
|
@ -905,7 +905,7 @@ function rcube_tasklist_ui(settings)
|
||||||
rcmail.env.request_timeout = 600;
|
rcmail.env.request_timeout = 600;
|
||||||
me.import_succeeded = null;
|
me.import_succeeded = null;
|
||||||
saving_lock = rcmail.set_busy(true, 'uploading');
|
saving_lock = rcmail.set_busy(true, 'uploading');
|
||||||
$('.ui-dialog-buttonpane button', $dialog.parent()).button('disable');
|
$('.ui-dialog-buttonpane button', $dialog.parent()).prop('disabled', true);
|
||||||
|
|
||||||
// restore settings
|
// restore settings
|
||||||
rcmail.env.request_timeout = timeout;
|
rcmail.env.request_timeout = timeout;
|
||||||
|
|
Loading…
Add table
Reference in a new issue