Skip to content

Commit

Permalink
ScrollForMore may listen for onClear() event
Browse files Browse the repository at this point in the history
  • Loading branch information
xirelogy committed Jul 18, 2021
1 parent d615ee9 commit eddce07
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions resources/js/VeloScrollForMore.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export default class VeloScrollForMore {
this._onStartBusy = Xw.$.defaultable(_options.onStartBusy);
this._onEndBusy = Xw.$.defaultable(_options.onEndBusy);
this._onNoMore = Xw.$.defaultable(_options.onNoMore);
this._onClear = Xw.$.defaultable(_options.onClear);
this._split = Xw.$.defaultable(_options.split, DEFAULT_SPLIT);

const _persist = Xw.$.defaultable(_options.persist);
Expand Down Expand Up @@ -83,6 +84,9 @@ export default class VeloScrollForMore {
*/
async reload() {
this._isFinal = false;
this._totalItems = 0;
if (this._onClear !== null) this._onClear();

if (this._persist) {
this._persist.delete(this._persistScroll);
this._persist.delete(this._persistCount);
Expand Down

0 comments on commit eddce07

Please sign in to comment.