diff --git a/client/modules/crm/src/views/calendar/calendar.js b/client/modules/crm/src/views/calendar/calendar.js index e9d068267a..fdf721a346 100644 --- a/client/modules/crm/src/views/calendar/calendar.js +++ b/client/modules/crm/src/views/calendar/calendar.js @@ -622,8 +622,17 @@ define('crm:views/calendar/calendar', ['view', 'lib!full-calendar'], function (D view.render(); view.notify(false); - this.listenToOnce(view, 'after:save', (model) => { - this.addModel(model); + let added = false; + + this.listenTo(view, 'after:save', (model) => { + if (!added) { + this.addModel(model); + added = true; + + return; + } + + this.updateModel(model); }); }); diff --git a/client/modules/crm/src/views/calendar/modals/edit.js b/client/modules/crm/src/views/calendar/modals/edit.js index 4444b1c251..875afba02d 100644 --- a/client/modules/crm/src/views/calendar/modals/edit.js +++ b/client/modules/crm/src/views/calendar/modals/edit.js @@ -26,7 +26,7 @@ * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ -define('crm:views/calendar/modals/edit', 'views/modals/edit', function (Dep) { +define('crm:views/calendar/modals/edit', ['views/modals/edit'], function (Dep) { return Dep.extend({ @@ -224,6 +224,10 @@ define('crm:views/calendar/modals/edit', 'views/modals/edit', function (Dep) { text: this.translate('Remove') }); } + + this.once('after:save', () => { + this.$el.find('.scope-switcher').remove(); + }) }, actionRemove: function () { diff --git a/client/modules/crm/src/views/calendar/timeline.js b/client/modules/crm/src/views/calendar/timeline.js index fdd94712c4..24a1646364 100644 --- a/client/modules/crm/src/views/calendar/timeline.js +++ b/client/modules/crm/src/views/calendar/timeline.js @@ -705,7 +705,7 @@ define('crm:views/calendar/timeline', ['view', 'lib!vis'], function (Dep, Vis) { view.render(); view.notify(false); - this.listenToOnce(view, 'after:save', () => { + this.listenTo(view, 'after:save', () => { this.runFetch(); }); }); diff --git a/client/src/views/modals/detail.js b/client/src/views/modals/detail.js index df065fe9c5..6b8cd98370 100644 --- a/client/src/views/modals/detail.js +++ b/client/src/views/modals/detail.js @@ -559,7 +559,7 @@ define('views/modals/detail', ['views/modal', 'helpers/action-item-setup'], func this.remove(); }); - this.listenToOnce(view, 'after:save', (model) => { + this.listenTo(view, 'after:save', (model) => { this.model.set(model.getClonedAttributes()); this.trigger('after:save', model);