Elastic: Fix RSVP recurring menu
Use rcmail's menu instead of jQuery-UI's menu.
This commit is contained in:
parent
2479385e04
commit
bc4a639e64
2 changed files with 19 additions and 30 deletions
|
@ -2380,7 +2380,7 @@ function rcube_calendar_ui(settings)
|
|||
}
|
||||
|
||||
// when the user accepts or declines an event invitation
|
||||
var event_rsvp = function(response, delegate, replymode)
|
||||
var event_rsvp = function(response, delegate, replymode, event)
|
||||
{
|
||||
var btn;
|
||||
if (typeof response == 'object') {
|
||||
|
@ -2394,8 +2394,8 @@ function rcube_calendar_ui(settings)
|
|||
// show menu to select rsvp reply mode (current or all)
|
||||
if (me.selected_event && me.selected_event.recurrence && !replymode) {
|
||||
rcube_libcalendaring.itip_rsvp_recurring(btn, function(resp, mode) {
|
||||
event_rsvp(resp, null, mode);
|
||||
});
|
||||
event_rsvp(resp, null, mode, event);
|
||||
}, event);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -2404,7 +2404,7 @@ function rcube_calendar_ui(settings)
|
|||
if (response == 'delegated' && !delegate) {
|
||||
rcube_libcalendaring.itip_delegate_dialog(function(data) {
|
||||
data.rsvp = data.rsvp ? 1 : '';
|
||||
event_rsvp('delegated', data, replymode);
|
||||
event_rsvp('delegated', data, replymode, event);
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
@ -4059,7 +4059,7 @@ function rcube_calendar_ui(settings)
|
|||
});
|
||||
|
||||
$('#event-rsvp input.button').click(function(e) {
|
||||
event_rsvp(this)
|
||||
event_rsvp(this, null, null, e.originalEvent);
|
||||
});
|
||||
|
||||
$('#eventedit input.edit-recurring-savemode').change(function(e) {
|
||||
|
|
|
@ -1311,36 +1311,25 @@ rcube_libcalendaring.itip_delegate_dialog = function(callback, selector)
|
|||
/**
|
||||
* Show a menu for selecting the RSVP reply mode
|
||||
*/
|
||||
rcube_libcalendaring.itip_rsvp_recurring = function(btn, callback)
|
||||
rcube_libcalendaring.itip_rsvp_recurring = function(btn, callback, event)
|
||||
{
|
||||
var menu = $('<ul></ul>').attr('class', 'popupmenu libcal-rsvp-replymode');
|
||||
var list, lc, menu = $('#itip-rsvp-menu'), action = btn.attr('rel');
|
||||
|
||||
$.each(['all','current'/*,'future'*/], function(i, mode) {
|
||||
$('<li>')
|
||||
.attr({rel: mode, 'class': 'ui-menu-item'})
|
||||
.append($('<a>').attr({tabindex: "0", 'class': 'ui-menu-item-wrapper'})
|
||||
.text(rcmail.get_label('rsvpmode' + mode)))
|
||||
.appendTo(menu);
|
||||
});
|
||||
if (!menu.length) {
|
||||
lc = $('body > #layout').length === 1 ? 'toolbarmenu listing' : 'toolbarmenu';
|
||||
menu = $('<div>').attr({'class': 'popupmenu', id: 'itip-rsvp-menu', 'aria-hidden': 'true'}).appendTo(document.body);
|
||||
list = $('<ul>').attr({'class': lc, role: 'menu'}).appendTo(menu);
|
||||
|
||||
var action = btn.attr('rel');
|
||||
$.each(['all','current'/*,'future'*/], function(i, mode) {
|
||||
var link = $('<a>').attr({'class': 'active', rel: mode})
|
||||
.text(rcmail.get_label('rsvpmode' + mode))
|
||||
.on('click', function() { callback(action, $(this).attr('rel')); });
|
||||
|
||||
// open the menu
|
||||
menu.menu({
|
||||
select: function(event, ui) {
|
||||
callback(action, ui.item.attr('rel'));
|
||||
}
|
||||
})
|
||||
.appendTo(document.body)
|
||||
.position({ my: 'left top', at: 'left bottom+2', of: btn })
|
||||
.data('action', action);
|
||||
|
||||
setTimeout(function() {
|
||||
$(document).one('click', function() {
|
||||
menu.menu('destroy');
|
||||
menu.remove();
|
||||
$('<li>').attr({role: 'menuitem'}).append(link).appendTo(list);
|
||||
});
|
||||
}, 100);
|
||||
}
|
||||
|
||||
rcmail.show_menu('itip-rsvp-menu', true, event);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue