Move ws update to respective classes

This commit is contained in:
Ludovic Stephan 2017-05-14 17:19:09 -03:00
parent 8b8a3f8a25
commit 31b742fdb7
3 changed files with 4 additions and 2 deletions

View file

@ -32,6 +32,9 @@ class KHistory {
if (!all_options.no_select)
this.selection = new KHistorySelection(this);
if (!all_options.static)
OperationWebSocket.add_handler(data => this.update_data(data));
var templates = all_options.templates
if (all_options.no_trigramme)
templates['opegroup'] =

View file

@ -438,6 +438,7 @@ class ArticleManager {
this.autocomplete = new ArticleAutocomplete(this, $container);
this._init_events();
OperationWebSocket.add_handler(data => this.update_data(data));
}
get nb() {

View file

@ -759,8 +759,6 @@ $(document).ready(function() {
// Synchronization
// -----
OperationWebSocket.add_handler(data => kpsul.history.update_data(data));
OperationWebSocket.add_handler(data => kpsul.article_manager.update_data(data));
OperationWebSocket.add_handler(function(data) {
if (data['addcost']) {
Config.set('addcost_for', data['addcost']['for']);