fix(calendar(js)): destination calendars of new components

Fixes #5581
This commit is contained in:
Francis Lachapelle
2022-08-19 10:07:14 -04:00
parent 1e4c134591
commit 3eeebbc83b

View File

@@ -279,9 +279,14 @@
};
this.destinationCalendars = function () {
if (this.component.isErasable)
if (this.component.isNew)
// New component, return all writable calendars
return Calendar.$findAll(null, true);
else if (this.component.isErasable)
// Movable component, return all writable calendars including current one
return Calendar.$findAll(null, true, this.component.pid);
else
// Component can't be moved
return [Calendar.$get(this.component.pid)];
};