var region = _stylePreviewRegions.get(lastValue);
var rect = region.getBoundingClientRect();
- var top = rect.top + document.body.scrollTop;
+ var top = rect.top + window.scrollY;
DomUtil.setStyles(_stylePreviewRegionMarker, {
height: (region.clientHeight + 20) + 'px',
if (align === 'top') {
var bodyHeight = document.body.clientHeight;
bottom = (bodyHeight - refOffsets.top) + verticalOffset;
- if (bodyHeight - (bottom + elDimensions.height) < document.body.scrollTop) {
+ if (bodyHeight - (bottom + elDimensions.height) < window.scrollY) {
result = false;
}
}
else {
top = refOffsets.top + refDimensions.height + verticalOffset;
- if (top + elDimensions.height - document.body.scrollTop > windowHeight) {
+ if (top + elDimensions.height - window.scrollY > windowHeight) {
result = false;
}
}
* @protected
*/
_scroll: function() {
- _isFixed = (document.body.scrollTop > 50);
+ _isFixed = (window.scrollY > 50);
_pageHeader.classList[_isFixed ? 'add' : 'remove']('sticky');
_pageHeaderContainer.classList[_isFixed ? 'add' : 'remove']('stickyPageHeader');
// get the offsets of the bounding box of current text selection
var rect = selection.getRangeAt(0).getBoundingClientRect();
var offsets = {
- top: Math.round(rect.bottom) + document.body.scrollTop,
+ top: Math.round(rect.bottom) + window.scrollY,
left: Math.round(rect.left) + document.body.scrollLeft
};
if (this._lineHeight === null) {
- this._lineHeight = Math.round(rect.bottom - rect.top - document.body.scrollTop);
+ this._lineHeight = Math.round(rect.bottom - rect.top - window.scrollY);
}
// restore caret position
this._selectItem(0);
- if (offset.top + this._dropdownMenu.offsetHeight + 10 > window.innerHeight + document.body.scrollTop) {
+ if (offset.top + this._dropdownMenu.offsetHeight + 10 > window.innerHeight + window.scrollY) {
this._dropdownMenu.classList.add('dropdownArrowBottom');
this._dropdownMenu.style.setProperty('top', offset.top - this._dropdownMenu.offsetHeight - 2 * this._lineHeight + 7 + 'px', '');
if (typeof event === 'object') {
// check if click occured within the ::before pseudo element
var rect = DomUtil.offset(element);
- if ((event.clientY + document.body.scrollTop) > (rect.top + _quotePaddingTop + _titleHeight)) {
+ if ((event.clientY + window.scrollY) > (rect.top + _quotePaddingTop + _titleHeight)) {
return;
}