mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-07-04 03:42:14 -04:00
much better ux
This commit is contained in:
parent
a536b311e4
commit
92450e071d
2 changed files with 5 additions and 7 deletions
|
@ -280,13 +280,12 @@ Scroll.prototype.scrollNodeVerticallyIntoView = function (rep, innerHeight, isPa
|
|||
// to inside of the viewport. Tested on IE, Firefox, Chrome in releases from 2015 until now
|
||||
// So, when the line scrolled gets outside of the viewport we let the browser handle it.
|
||||
const linePosition = caretPosition.getPosition();
|
||||
|
||||
if (isPageUp) {
|
||||
// redraw entire page into view putting rep.selStart[0] at top left
|
||||
const distanceOfTopOfViewport = linePosition.top - viewport.top;
|
||||
const pixelsToScroll =
|
||||
distanceOfTopOfViewport - this._getPixelsRelativeToPercentageOfViewport(innerHeight, true);
|
||||
this._scrollYPage(pixelsToScroll);
|
||||
this._scrollYPage(pixelsToScroll - linePosition.height);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue