Skip to content

Commit

Permalink
Merge pull request #2823 from rebeccacremona/waypoints
Browse files Browse the repository at this point in the history
Destroy infinite scroll waypoints when switching folders.
  • Loading branch information
bensteinberg committed Jul 27, 2020
2 parents 1b8e45a + 80bf159 commit ef1f5c1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion perma_web/static/bundles/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -13565,9 +13565,11 @@ function initShowFolderDOM(query) {
if (!query || !_babel_runtime_corejs3_core_js_stable_instance_trim__WEBPACK_IMPORTED_MODULE_5___default()(query).call(query)) {
// clear query after user clicks a folder
DOMHelpers.setInputValue('.search-query', '');
} // if fetching folder contents takes more than 500ms, show a loading message
} // destroy any existing infinite scroll Waypoints


Waypoint.destroyAll(); // if fetching folder contents takes more than 500ms, show a loading message

showLoadingMessage = true;

_babel_runtime_corejs3_core_js_stable_set_timeout__WEBPACK_IMPORTED_MODULE_2___default()(function () {
Expand Down
3 changes: 3 additions & 0 deletions perma_web/static/js/links-list.module.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ function initShowFolderDOM (query) {
DOMHelpers.setInputValue('.search-query', '');
}

// destroy any existing infinite scroll Waypoints
Waypoint.destroyAll();

// if fetching folder contents takes more than 500ms, show a loading message
showLoadingMessage = true;
setTimeout(function(){
Expand Down

0 comments on commit ef1f5c1

Please sign in to comment.