Skip to content

Commit dd665f4

Browse files
committed
修复选项卡切换+下拉刷新滚动到底部后按住一直上拉不断触发上拉加载的bug
1 parent 4d349ae commit dd665f4

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

examples/hello-mui/js/mui.pullToRefresh.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
},
5959
initEvent: function() {
6060
if ($.isFunction(this.options.down.callback)) {
61-
this.element.addEventListener('touchstart', this);
61+
this.element.addEventListener($.EVENT_START, this);
6262
this.element.addEventListener('drag', this);
6363
this.element.addEventListener('dragend', this);
6464
}
@@ -73,7 +73,7 @@
7373
},
7474
handleEvent: function(e) {
7575
switch (e.type) {
76-
case 'touchstart':
76+
case $.EVENT_START:
7777
this.isInScroll && this._canPullDown() && e.target && !this._preventDefaultException(e.target, this.options.preventDefaultException) && e.preventDefault();
7878
break;
7979
case 'drag':
@@ -347,6 +347,9 @@
347347
} else {
348348
this.removing = true;
349349
}
350+
if (this.isInScroll) {
351+
$(this.element.parentNode).scroll().refresh();
352+
}
350353
},
351354
endPullUpToRefresh: function(finished) {
352355
if (finished) {
@@ -358,6 +361,9 @@
358361
this.pullUpTipsIcon.innerHTML = this.options.up.contentdown;
359362
}
360363
this.loading = false;
364+
if (this.isInScroll) {
365+
$(this.element.parentNode).scroll().refresh();
366+
}
361367
},
362368
setStopped: function(stopped) {
363369
if (stopped != this.stopped) {

0 commit comments

Comments
 (0)