mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Once products start loading, scroll higher, ie. just above filters
can see the loading spinner then
This commit is contained in:
@@ -11,6 +11,7 @@ export default class extends ApplicationController {
|
||||
|
||||
beforeReflex() {
|
||||
this.showLoading();
|
||||
this.scrollToElement();
|
||||
}
|
||||
|
||||
afterReflex() {
|
||||
@@ -29,6 +30,10 @@ export default class extends ApplicationController {
|
||||
}
|
||||
};
|
||||
|
||||
scrollToElement = () => {
|
||||
this.element.scrollIntoView();
|
||||
};
|
||||
|
||||
getLoadingController = () => {
|
||||
return (this.loadingController ||= this.application.getControllerForElementAndIdentifier(
|
||||
this.loadingTarget,
|
||||
|
||||
Reference in New Issue
Block a user