-
Robert Knight authored
When using a custom bucket container, the top / bottom buckets may be positioned differently than the code previously assumed (137x px below the top of the viewport, 20px above the bottom). Redo the logic to work regardless of bucket container positioning. Instead of trying to determine whether an anchor is on-screen or not, just pick the anchor with the lowest bottom or highest top as the "nearest" one, depending on which direction we are scrolling in. This is implemented by: - Changing `Bucket` objects to record not just the tags from anchors in them, but the list of `AnchorPosition` objects from which the bucket was built. These objects include the top and bottom positions of the anchor. - Make clicking on the "Up" bucket search the anchor list for the anchor with the lowest bottom position, and send a request to the guest to scroll to that anchor. - Make clicking on the "Down" bucket search the anchor list for the anchor with the highest top position, and send a request to the guest to scroll to that anchor. - Removing all the logic for finding and scrolling to the "nearest off-screen anchor"
6d76d194
Name |
Last commit
|
Last update |
---|---|---|
.. | ||
annotator.ts | ||
api.ts | ||
config.js | ||
lodash.debounce.d.ts | ||
pdfjs.ts | ||
port-rpc-events.d.ts | ||
process.d.ts | ||
rpc.js | ||
shared.ts | ||
sidebar.js | ||
vitalsource.ts |