dropDown error corregido cuando el servidor tarda en responder

This commit is contained in:
Daniel Herrero 2018-01-09 14:21:17 +01:00
parent 628c77a440
commit dd1b8655a5
1 changed files with 10 additions and 2 deletions

View File

@ -86,9 +86,17 @@ export default class DropDown {
});
}
_eventScroll(add) {
_eventScroll(add, num) {
let count = num || 0;
if (add) {
this.container.addEventListener('scroll', e => this.loadFromScroll(e));
if (this.container)
this.container.addEventListener('scroll', e => this.loadFromScroll(e));
else if (count < 4) {
count++;
this.$timeout(() => { // wait angular ngIf
this._eventScroll(add, count);
}, 250);
}
} else {
this.container.removeEventListener('scroll', e => this.loadFromScroll(e));
}