diff --git a/client/src/views/email/detail.js b/client/src/views/email/detail.js index 1c67f7c275..ca2b262e00 100644 --- a/client/src/views/email/detail.js +++ b/client/src/views/email/detail.js @@ -168,6 +168,9 @@ define('views/email/detail', ['views/detail', 'email-helper'], function (Dep, Em }, function (view) { view.render(); view.notify(false); + this.listenTo(view, 'before:save', function () { + this.getView('record').blockUpdateWebSocket(true); + }, this); this.listenToOnce(view, 'after:save', function () { this.model.fetch(); this.removeMenuItem('createContact'); @@ -227,6 +230,9 @@ define('views/email/detail', ['views/detail', 'email-helper'], function (Dep, Em this.removeMenuItem('createCase'); view.close(); }, this); + this.listenTo(view, 'before:save', function () { + this.getView('record').blockUpdateWebSocket(true); + }, this); }); }.bind(this)); }, @@ -306,6 +312,9 @@ define('views/email/detail', ['views/detail', 'email-helper'], function (Dep, Em this.removeMenuItem('createLead'); view.close(); }.bind(this)); + this.listenTo(view, 'before:save', function () { + this.getView('record').blockUpdateWebSocket(true); + }, this); }.bind(this)); }, diff --git a/client/src/views/modals/edit.js b/client/src/views/modals/edit.js index b1a2c7da77..e67902a94a 100644 --- a/client/src/views/modals/edit.js +++ b/client/src/views/modals/edit.js @@ -169,6 +169,10 @@ Espo.define('views/modals/edit', 'views/modal', function (Dep) { this.dialog.close(); }, this); + editView.once('before:save', function () { + this.trigger('before:save', model); + }, this); + var $buttons = this.dialog.$el.find('.modal-footer button'); $buttons.addClass('disabled').attr('disabled', 'disabled'); diff --git a/client/src/views/record/detail.js b/client/src/views/record/detail.js index 434ae463d8..bcaeb81043 100644 --- a/client/src/views/record/detail.js +++ b/client/src/views/record/detail.js @@ -1837,8 +1837,14 @@ define('views/record/detail', ['views/record/base', 'view-record-helper'], funct } }, - blockUpdateWebSocket: function () { + blockUpdateWebSocket: function (toUnblock) { this.updateWebSocketIsBlocked = true; + + if (toUnblock) { + setTimeout(function () { + this.unblockUpdateWebSocket(); + }.bind(this), this.blockUpdateWebSocketPeriod || 500); + } }, unblockUpdateWebSocket: function () {