MUI在没有更多数据后默认将上拉事件取消监听,这个做法本身不存在问题
但是大多情况下,上拉一般是跟下拉刷新同时存在
如果没有更多数据后客户进行下拉刷新会发现数据永远不会再加载了
以下是相关修复代码
endPullup:function(finished) {//上拉加载结束
var self = this;
if (self.pullLoading) {
self.pullLoading.classList.remove(CLASS_VISIBILITY);
self.pullLoading.classList.add(CLASS_HIDDEN);
self.isLoading = false;
if (finished) {
self.finished = true;
self.pullCaption.className = CLASS_PULL_CAPTION + ' ' + CLASS_PULL_CAPTION_NOMORE;
self.pullCaption.innerHTML = self.options.up.contentnomore;
//取消5+的plusscrollbottom事件
document.removeEventListener('plusscrollbottom', self);
window.removeEventListener('dragup', self);
} else { //初始化时隐藏,后续不再隐藏
self.pullCaption.className = CLASS_PULL_CAPTION + ' ' + CLASS_PULL_CAPTION_DOWN;
self.pullCaption.innerHTML = self.options.up.contentdown;
//修复代码,加上后,在相关的下拉刷新调用方法内调用mui('#pullrefresh').pullRefresh().endPullupToRefresh(false);
self.finished = false;
document.addEventListener('plusscrollbottom', self);
window.addEventListener('dragup', self);
}
}
},
1 个评论
要回复文章请先登录或注册
wen如故i