websocket update fixes

This commit is contained in:
Yuri Kuznetsov
2020-05-25 11:46:51 +03:00
parent 90589e0d26
commit 774bde3e20
3 changed files with 20 additions and 1 deletions
+9
View File
@@ -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));
},
+4
View File
@@ -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');
+7 -1
View File
@@ -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 () {