0
Fork 0
mirror of https://github.com/fastmail/Squire.git synced 2024-12-22 07:13:08 -05:00

Make scroll on enter logic independent of CSS.

Fixes #149.
This commit is contained in:
Neil Jenkins 2015-10-23 17:05:32 +01:00
parent 85c9002ce5
commit 162ec9049e
3 changed files with 8 additions and 12 deletions

View file

@ -1395,11 +1395,9 @@ var keyHandlers = {
if ( nodeAfterSplit.nodeType === TEXT_NODE ) {
nodeAfterSplit = nodeAfterSplit.parentNode;
}
var doc = self._doc,
body = self._body;
if ( nodeAfterSplit.offsetTop + nodeAfterSplit.offsetHeight >
( doc.documentElement.scrollTop || body.scrollTop ) +
body.offsetHeight ) {
// 16 ~ one standard line height in px.
if ( nodeAfterSplit.getBoundingClientRect().top + 16 >
self._doc.documentElement.clientHeight ) {
nodeAfterSplit.scrollIntoView( false );
}
},

File diff suppressed because one or more lines are too long

View file

@ -246,11 +246,9 @@ var keyHandlers = {
if ( nodeAfterSplit.nodeType === TEXT_NODE ) {
nodeAfterSplit = nodeAfterSplit.parentNode;
}
var doc = self._doc,
body = self._body;
if ( nodeAfterSplit.offsetTop + nodeAfterSplit.offsetHeight >
( doc.documentElement.scrollTop || body.scrollTop ) +
body.offsetHeight ) {
// 16 ~ one standard line height in px.
if ( nodeAfterSplit.getBoundingClientRect().top + 16 >
self._doc.documentElement.clientHeight ) {
nodeAfterSplit.scrollIntoView( false );
}
},