Fix bug where Save as Event (and task) form was visible before the dialog was created
This commit is contained in:
parent
65d7c7e6f8
commit
9ba3165560
5 changed files with 30 additions and 27 deletions
|
@ -49,29 +49,29 @@ function rcube_calendar(settings)
|
|||
$.when(
|
||||
$.getScript(rcmail.assets_path('plugins/calendar/calendar_ui.js')),
|
||||
$.getScript(rcmail.assets_path('plugins/calendar/lib/js/fullcalendar.js')),
|
||||
$.get(rcmail.url('calendar/inlineui'), function(html){ $(document.body).append(html); }, 'html')
|
||||
$.get(rcmail.url('calendar/inlineui'), function(html) { $(document.body).append(html); }, 'html')
|
||||
).then(function() {
|
||||
// disable attendees feature (autocompletion and stuff is not initialized)
|
||||
for (var c in rcmail.env.calendars)
|
||||
rcmail.env.calendars[c].attendees = rcmail.env.calendars[c].resources = false;
|
||||
|
||||
|
||||
me.ui_loaded = true;
|
||||
me.ui = new rcube_calendar_ui(me.settings);
|
||||
me.create_from_mail(uid); // start over
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
else {
|
||||
// get message contents for event dialog
|
||||
var lock = rcmail.set_busy(true, 'loading');
|
||||
rcmail.http_post('calendar/mailtoevent', {
|
||||
'_mbox': rcmail.env.mailbox,
|
||||
'_uid': uid
|
||||
}, lock);
|
||||
}
|
||||
|
||||
// get message contents for event dialog
|
||||
var lock = rcmail.set_busy(true, 'loading');
|
||||
rcmail.http_post('calendar/mailtoevent', {
|
||||
'_mbox': rcmail.env.mailbox,
|
||||
'_uid': uid
|
||||
}, lock);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// callback function triggered from server with contents for the new event
|
||||
this.mail2event_dialog = function(event)
|
||||
{
|
||||
|
@ -105,11 +105,11 @@ window.rcmail && rcmail.addEventListener('init', function(evt) {
|
|||
|
||||
// register create-from-mail command to message_commands array
|
||||
if (rcmail.env.task == 'mail') {
|
||||
rcmail.register_command('calendar-create-from-mail', function() { cal.create_from_mail() });
|
||||
rcmail.register_command('attachment-save-calendar', function() { cal.save_to_calendar() });
|
||||
rcmail.addEventListener('plugin.mail2event_dialog', function(p){ cal.mail2event_dialog(p) });
|
||||
rcmail.addEventListener('plugin.unlock_saving', function(p){ cal.ui && cal.ui.unlock_saving(); });
|
||||
|
||||
rcmail.register_command('calendar-create-from-mail', function() { cal.create_from_mail(); });
|
||||
rcmail.register_command('attachment-save-calendar', function() { cal.save_to_calendar(); });
|
||||
rcmail.addEventListener('plugin.mail2event_dialog', function(p) { cal.mail2event_dialog(p); });
|
||||
rcmail.addEventListener('plugin.unlock_saving', function(p) { cal.ui && cal.ui.unlock_saving(); });
|
||||
|
||||
if (rcmail.env.action != 'show') {
|
||||
rcmail.env.message_commands.push('calendar-create-from-mail');
|
||||
rcmail.add_element($('<a>'));
|
||||
|
@ -129,8 +129,8 @@ window.rcmail && rcmail.addEventListener('init', function(evt) {
|
|||
}
|
||||
|
||||
rcmail.register_command('plugin.calendar', function() { rcmail.switch_task('calendar'); }, true);
|
||||
|
||||
rcmail.addEventListener('plugin.ping_url', function(p){
|
||||
|
||||
rcmail.addEventListener('plugin.ping_url', function(p) {
|
||||
var action = p.action;
|
||||
p.action = p.event = null;
|
||||
new Image().src = rcmail.url(action, p);
|
||||
|
|
|
@ -373,6 +373,7 @@ pre {
|
|||
right: 4px;
|
||||
}
|
||||
|
||||
#eventedit.uidialog,
|
||||
.calendarmain div.uidialog {
|
||||
display: none;
|
||||
}
|
||||
|
|
|
@ -539,6 +539,7 @@ body.calendarmain #searchmenulink {
|
|||
width: 15px;
|
||||
}
|
||||
|
||||
#eventedit.uidialog,
|
||||
.calendarmain div.uidialog {
|
||||
display: none;
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@ ul.toolbarmenu li span.icon.taskadd,
|
|||
background-position: -4px -90px;
|
||||
}
|
||||
|
||||
#taskedit.uidialog,
|
||||
.tasklistview div.uidialog {
|
||||
display: none;
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ function rcube_tasklist(settings)
|
|||
if (!ui_loaded) {
|
||||
$.when(
|
||||
$.getScript(rcmail.assets_path('plugins/tasklist/tasklist.js')),
|
||||
$.get(rcmail.url('tasks/inlineui'), function(html){ $(document.body).append(html); }, 'html')
|
||||
$.get(rcmail.url('tasks/inlineui'), function(html) { $(document.body).append(html); }, 'html')
|
||||
).then(function() {
|
||||
// register attachments form
|
||||
// rcmail.gui_object('attachmentlist', 'attachmentlist');
|
||||
|
@ -60,16 +60,16 @@ function rcube_tasklist(settings)
|
|||
me.ui = new rcube_tasklist_ui($.extend(rcmail.env.tasklist_settings, settings));
|
||||
create_from_mail(uid); // start over
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
else {
|
||||
// get message contents for task dialog
|
||||
var lock = rcmail.set_busy(true, 'loading');
|
||||
rcmail.http_post('tasks/mail2task', {
|
||||
'_mbox': rcmail.env.mailbox,
|
||||
'_uid': uid
|
||||
}, lock);
|
||||
}
|
||||
|
||||
// get message contents for task dialog
|
||||
var lock = rcmail.set_busy(true, 'loading');
|
||||
rcmail.http_post('tasks/mail2task', {
|
||||
'_mbox': rcmail.env.mailbox,
|
||||
'_uid': uid
|
||||
}, lock);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue