Fixed bug introduced in quick reading feature when within-viewport.js was replaced with isInViewport.js
The old within-viewport did not always work correctly, but had a more powerful API than isInViewport. In particular it was possible to select entries that were outside the viewport and above it; this is not possible with isInViewport, only entries in the viewport can be selected (there is a tolerance option in isInViewport but it doesn't seem to work correctly).
This was the reason why, when switching from one js library to the other, the selection of entries to be marked as read was changed so that all entries in the viewport were selected. This meant that every time the user scrolled, all visible entries were marked as read. This is not the intended behavior: we want entries above the viewport to be marked read.
The old jquery selectors cannot be trivially adapted for isInViewport, so the feature has been rewritten. Now after every scroll event the first visible entry is selected, and any entries in the global entries list before that one are marked as read, unless they are already marked as read.
The code is more complicated and probably less performant than what I had with within-viewport, but at least isInViewport is under active maintenance.
↧