Commit c92742b7 authored by Prakhar Agarwal's avatar Prakhar Agarwal 🎯
Browse files

search match gets scrolled into view

parent 6e7b9aaa
......@@ -116,7 +116,6 @@ var console_find_traverse = (function () {
}
// adjust the scrollbar to make sure the element is visible,
// but only if necessary.
// I don't think this is available on all browsers...
var isFirefox = typeof InstallTrigger !== 'undefined'; // checks if browser is Firefox or not
if (isFirefox) {
elements[i].scrollIntoView();
......@@ -145,7 +144,6 @@ var console_find_traverse = (function () {
}
// adjust the scrollbar to make sure the element is visible,
// but only if necessary.
// I don't think this is available on all browsers...
var isFirefox = typeof InstallTrigger !== 'undefined'; // checks if browser is Firefox or not
if (isFirefox) {
elements[i].scrollIntoView();
......@@ -162,6 +160,14 @@ var console_find_traverse = (function () {
if (elements.length > 0) {
elements[0].classList.add("console_find_current");
}
// adjust the scrollbar to make sure the element is visible,
// but only if necessary.
var isFirefox = typeof InstallTrigger !== 'undefined'; // checks ifbrowser is Firefox or not
if (isFirefox) {
elements[0].scrollIntoView();
} else {
elements[0].scrollIntoViewIfNeeded();
}
}
};
}());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment