Skip to content

Commit

Permalink
scrollIntoViewIfNeeded fix for Firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
semyonc committed Apr 12, 2021
1 parent 3f09177 commit 9a48c8a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
16 changes: 8 additions & 8 deletions iXBRLViewerPlugin/viewer/dist/ixbrlviewer.js

Large diffs are not rendered by default.

5 changes: 1 addition & 4 deletions iXBRLViewerPlugin/viewer/src/js/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -347,10 +347,7 @@ Viewer.prototype.scrollIntoViewIfNeeded = function(e) {
var eTop = e.offset().top;
var eBottom = eTop + e.height();
if (eTop < viewTop || eBottom > viewBottom) {
var scrollParent = getScrollParent(e[0]);
if (getStyleComputedProperty(scrollParent, 'position') !== 'absolute')
scrollParent = this._iframes.contents();
$(scrollParent).scrollTop(e.offset().top - this._iframes.height()/2);
e[0].scrollIntoView({block: "center"});
}
}
}
Expand Down

0 comments on commit 9a48c8a

Please sign in to comment.