Switch back to a custom spinner detection, as the IntersectionObserver
is eating a lot of CPU resources on idle.
This should also take care of #2250 properly: the previous `onDestroyed()`
was removing the resize and scroll callbacks, but they were not unique
enough, and they were shared across swimlanes. So if a list had 2 swimlanes
with spinners, when one was removed, the other was not triggering its
callbacks anymore.
Related: #2294
- [#2250 -> the spinner could be shown on startup and never goes away](https://github.com/wekan/wekan/issues/2250).
- The code will now only load extra cards that will be in the current viewport.
- When 2 users were interacting on the same board, there was a situation where the spinner could show up on the other user, without being able to load the extra cards.
- The code is now much simpler, thanks to the IntersectionObserver, and all of this for fewer lines of code :)
Thanks to bentiss with Apache I-CLA !
Closes#2250
This way, when a list is at the maximum number of cards shown and adding
a new card would make the spinner appear, the list would load the next
N items.
This can happen if user A and B are both looking at the same board,
B adds a new cards, and A will see the spinner and will not be able to
remove it.
When loading a board on a high resolution screen, there is a chance there
is not enough cards displayed and the spinner is still there, spinning
forever.
Add an idle callback that checks if the spinner is still there, and while
it is there, extend the number of cards to show.
Fixes#2250
because newer api2html caused
[breaking change](a9a41bca18)
at api2html/bin/api2html.js:23 has error about "php: "PHP".
Thanks to bentiss with Apache I-CLA !
Closes#2286