From a52e68c07d7c837ae99985bdbd0d18e2004e624b Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Thu, 31 Oct 2019 19:08:27 +0000 Subject: [PATCH] Calendar: Fix Options menu in event info dialog (Bifrost#T254738) --- plugins/calendar/calendar_ui.js | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/plugins/calendar/calendar_ui.js b/plugins/calendar/calendar_ui.js index a6e288dc..571c1530 100644 --- a/plugins/calendar/calendar_ui.js +++ b/plugins/calendar/calendar_ui.js @@ -563,6 +563,11 @@ function rcube_calendar_ui(settings) } }); + var close_func = function(e) { + rcmail.command('menu-close', 'eventoptionsmenu', null, e); + $('.libcal-rsvp-replymode').hide(); + }; + // open jquery UI dialog $dialog.dialog({ modal: true, @@ -575,21 +580,12 @@ function rcube_calendar_ui(settings) $dialog.parent().find('button:not(.ui-dialog-titlebar-close,.delete)').first().focus(); }, 5); }, - beforeClose: function(e) { - rcmail.command('menu-close', 'eventoptionsmenu', null, e); - }, close: function(e) { - $dialog.dialog('destroy').attr('aria-hidden', 'true').hide(); - $('.libcal-rsvp-replymode').hide(); - }, - dragStart: function(e) { - rcmail.command('menu-close', 'eventoptionsmenu', null, e); - $('.libcal-rsvp-replymode').hide(); - }, - resizeStart: function(e) { - rcmail.command('menu-close', 'eventoptionsmenu', null, e); - $('.libcal-rsvp-replymode').hide(); + close_func(e); + $dialog.dialog('close'); }, + dragStart: close_func, + resizeStart: close_func, buttons: buttons, minWidth: 320, width: 420 @@ -611,12 +607,12 @@ function rcube_calendar_ui(settings) .attr({href: '#', 'class': 'dropdown-link btn btn-link options', 'data-popup-pos': 'top'}) .text(rcmail.gettext('eventoptions','calendar')) .click(function(e) { - return rcmail.command('menu-open','eventoptionsmenu', this, e) + return rcmail.command('menu-open','eventoptionsmenu', this, e); }) .appendTo($dialog.parent().find('.ui-dialog-buttonset')); } - rcmail.enable_command('event-history', calendar.history) + rcmail.enable_command('event-history', calendar.history); rcmail.triggerEvent('calendar-event-dialog', {dialog: $dialog}); }; @@ -626,12 +622,14 @@ function rcube_calendar_ui(settings) { var cutype = $(this).attr('data-cutype'), mailto = this.href.substr(7); + if (rcmail.env.calendar_resources && cutype == 'RESOURCE') { event_resources_dialog(mailto); } else { rcmail.command('compose', mailto, e ? e.target : null, e); } + return false; }; @@ -3179,9 +3177,9 @@ function rcube_calendar_ui(settings) if (v.role != 'ORGANIZER') { v.status = 'NEEDS-ACTION'; } - }) + }); - event_edit_dialog('new', copy); + setTimeout(function() { event_edit_dialog('new', copy); }, 50); } };