Avoid javascript errors in email view when creating event from mail
This commit is contained in:
parent
b10dcd2b95
commit
dddb045c1d
1 changed files with 9 additions and 6 deletions
|
@ -2807,9 +2807,10 @@ function rcube_calendar_ui(settings)
|
||||||
};
|
};
|
||||||
|
|
||||||
// mark the given calendar folder as selected
|
// mark the given calendar folder as selected
|
||||||
this.select_calendar = function(id)
|
this.select_calendar = function(id, nolistupdate)
|
||||||
{
|
{
|
||||||
calendars_list.select(id);
|
if (!nolistupdate)
|
||||||
|
calendars_list.select(id);
|
||||||
|
|
||||||
// trigger event hook
|
// trigger event hook
|
||||||
rcmail.triggerEvent('selectfolder', { folder:id, prefix:'rcmlical' });
|
rcmail.triggerEvent('selectfolder', { folder:id, prefix:'rcmlical' });
|
||||||
|
@ -2870,7 +2871,7 @@ function rcube_calendar_ui(settings)
|
||||||
add_calendar_source(cal);
|
add_calendar_source(cal);
|
||||||
|
|
||||||
// check active calendars
|
// check active calendars
|
||||||
$('#rcmlical'+id+' > .calendar input').get(0).checked = active;
|
$('#rcmlical'+id+' > .calendar input').prop('checked', active);
|
||||||
|
|
||||||
if (active) {
|
if (active) {
|
||||||
event_sources.push(this.calendars[id]);
|
event_sources.push(this.calendars[id]);
|
||||||
|
@ -2895,9 +2896,11 @@ function rcube_calendar_ui(settings)
|
||||||
search_title: rcmail.gettext('calsearchresults','calendar')
|
search_title: rcmail.gettext('calsearchresults','calendar')
|
||||||
});
|
});
|
||||||
calendars_list.addEventListener('select', function(node) {
|
calendars_list.addEventListener('select', function(node) {
|
||||||
me.select_calendar(node.id);
|
if (node && node.id && me.calendars[node.id]) {
|
||||||
rcmail.enable_command('calendar-edit', 'calendar-showurl', true);
|
me.select_calendar(node.id, true);
|
||||||
rcmail.enable_command('calendar-remove', !me.calendars[node.id].readonly);
|
rcmail.enable_command('calendar-edit', 'calendar-showurl', true);
|
||||||
|
rcmail.enable_command('calendar-remove', !me.calendars[node.id].readonly);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
calendars_list.addEventListener('insert-item', function(p) {
|
calendars_list.addEventListener('insert-item', function(p) {
|
||||||
var cal = p.data;
|
var cal = p.data;
|
||||||
|
|
Loading…
Add table
Reference in a new issue