fix stream fetched twice

This commit is contained in:
yuri
2015-06-12 14:50:54 +03:00
parent 23ef028cb4
commit 344da24b5e
+9 -6
View File
@@ -114,9 +114,7 @@ Espo.define('Views.Stream.Panel', ['Views.Record.Panels.Relationship', 'lib!Text
var collection = this.collection;
this.listenTo(this.model, 'sync', function () {
collection.fetchNew();
}.bind(this));
this.listenToOnce(collection, 'sync', function () {
this.createView('list', 'Stream.List', {
@@ -126,10 +124,15 @@ Espo.define('Views.Stream.Panel', ['Views.Record.Panels.Relationship', 'lib!Text
}, function (view) {
view.render();
});
}.bind(this));
collection.fetch();
var self = this;
setTimeout(function () {
this.listenTo(this.model, 'sync', function () {
collection.fetchNew();
}, this);
}.bind(this), 500);
}, this);
collection.fetch();
this.$textarea.textcomplete([{
match: /(^|\s)@(\w*)$/,