fixup 362d9444: autoscroll manage page only during incremental search

This commit is contained in:
tophf 2017-11-30 01:13:13 +03:00
parent 6f0dd5e9b6
commit a61ee5f093
3 changed files with 3 additions and 3 deletions

View File

@ -89,7 +89,7 @@ function onDOMready() {
} }
function scrollElementIntoView(element, {invalidMarginRatio = .25} = {}) { function scrollElementIntoView(element, {invalidMarginRatio = 0} = {}) {
// align to the top/bottom of the visible area if wasn't visible // align to the top/bottom of the visible area if wasn't visible
const {top, height} = element.getBoundingClientRect(); const {top, height} = element.getBoundingClientRect();
const {top: parentTop, bottom: parentBottom} = element.parentNode.getBoundingClientRect(); const {top: parentTop, bottom: parentBottom} = element.parentNode.getBoundingClientRect();

View File

@ -64,7 +64,7 @@ onDOMready().then(() => {
focusedEntry = found; focusedEntry = found;
focusedLink = $('.style-name-link', found); focusedLink = $('.style-name-link', found);
focusedName = found.styleNameLowerCase; focusedName = found.styleNameLowerCase;
scrollElementIntoView(found); scrollElementIntoView(found, {invalidMarginRatio: .25});
animateElement(found, {className: 'highlight-quick'}); animateElement(found, {className: 'highlight-quick'});
resizeTo(focusedLink); resizeTo(focusedLink);
return true; return true;

View File

@ -406,7 +406,7 @@ function handleUpdate(style, {reason, method} = {}) {
filterAndAppend({entry}); filterAndAppend({entry});
if (!entry.matches('.hidden') && reason !== 'import') { if (!entry.matches('.hidden') && reason !== 'import') {
animateElement(entry); animateElement(entry);
scrollElementIntoView(entry, {invalidMarginRatio: 0}); scrollElementIntoView(entry);
} }
function handleToggledOrCodeOnly() { function handleToggledOrCodeOnly() {