Move an event from a calendar to another
parent
63581e2cf3
commit
547b0c1d3e
|
@ -748,10 +748,7 @@ Messages.calendar_import = "Import to my calendars";
|
|||
return;
|
||||
}
|
||||
var isUpdate = Boolean($el.find('#tui-full-calendar-schedule-title').val());
|
||||
if (isUpdate) {
|
||||
$el.find('.tui-full-calendar-dropdown-button').attr('disabled', 'disabled').off('click');
|
||||
$el.find('.tui-full-calendar-dropdown-menu').addClass('cp-forcehide');
|
||||
}
|
||||
if (!isUpdate) { $el.find('.tui-full-calendar-dropdown-menu li').first().click(); }
|
||||
};
|
||||
var onCalendarEditPopup = function (el) {
|
||||
// TODO
|
||||
|
|
|
@ -552,11 +552,27 @@ ctx.calendars[channel] = {
|
|||
|
||||
// update the event
|
||||
var changes = data.changes || {};
|
||||
|
||||
var newC;
|
||||
if (changes.calendarId) {
|
||||
newC = ctx.calendars[changes.calendarId];
|
||||
if (!newC || !newC.proxy || !newC.proxy.content) { return void cb({error: "ENOENT"}); }
|
||||
}
|
||||
|
||||
Object.keys(changes).forEach(function (key) {
|
||||
ev[key] = changes[key];
|
||||
});
|
||||
|
||||
Realtime.whenRealtimeSyncs(c.lm.realtime, cb);
|
||||
// Move to a different calendar?
|
||||
if (changes.calendarId && newC) {
|
||||
newC.proxy.content[data.ev.id] = Util.clone(ev);
|
||||
delete c.proxy.content[data.ev.id];
|
||||
}
|
||||
|
||||
nThen(function (waitFor) {
|
||||
Realtime.whenRealtimeSyncs(c.lm.realtime, waitFor());
|
||||
if (newC) { Realtime.whenRealtimeSyncs(newC.lm.realtime, waitFor()); }
|
||||
}).nThen(cb);
|
||||
};
|
||||
var deleteEvent = function (ctx, data, cId, cb) {
|
||||
var id = data.calendarId;
|
||||
|
|
Loading…
Reference in New Issue