[Improvement] reduce scroll utils (#1112)

This commit is contained in:
neverland
2018-05-20 00:07:45 +08:00
committed by GitHub
parent d15efd756e
commit b5139b18eb
2 changed files with 6 additions and 51 deletions

View File

@@ -12,7 +12,7 @@ function doBindEvent() {
}
this.el[CONTEXT].binded = true;
this.scrollEventListener = Utils.debounce(handleScrollEvent.bind(this), 200);
this.scrollEventListener = handleScrollEvent.bind(this);
this.scrollEventTarget = Utils.getScrollEventTarget(this.el);
const disabledExpr = this.el.getAttribute('waterfall-disabled');
@@ -78,10 +78,8 @@ function handleScrollEvent() {
function startBind(el) {
const context = el[CONTEXT];
context.vm.$nextTick(function() {
if (Utils.isAttached(el)) {
doBindEvent.call(el[CONTEXT]);
}
context.vm.$nextTick(() => {
doBindEvent.call(el[CONTEXT]);
});
}