Skip to content

Commit 16f3a2b

Browse files
committed
🐞 fix last status showing #706
1 parent cf84f4e commit 16f3a2b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

β€Žjs/status.jsβ€Ž

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,12 @@ InfiniteScroll.create.status = function() {
4848
this.on( 'request', this.showRequestStatus );
4949
this.on( 'error', this.showErrorStatus );
5050
this.on( 'last', this.showLastStatus );
51+
this.bindHideStatus('on');
52+
};
53+
54+
proto.bindHideStatus = function( bindMethod ) {
5155
var hideEvent = this.options.append ? 'append' : 'load';
52-
this.on( hideEvent, this.hideAllStatus );
56+
this[ bindMethod ]( hideEvent, this.hideAllStatus );
5357
};
5458

5559
proto.showRequestStatus = function() {
@@ -62,6 +66,8 @@ proto.showErrorStatus = function() {
6266

6367
proto.showLastStatus = function() {
6468
this.showStatus('last');
69+
// prevent last then append event race condition from showing last status #706
70+
this.bindHideStatus('off');
6571
};
6672

6773
proto.showStatus = function( eventName ) {

0 commit comments

Comments
Β (0)