Commit 5ce5efde authored by cinwell.li's avatar cinwell.li Committed by GitHub

Merge pull request #60 from Leopoldthecoder/next

fix a compatibility bug of loading
parents d607187d 7de121ad
......@@ -69,7 +69,8 @@ exports.install = Vue => {
el.originalPosition = document.body.style.position;
['top', 'left'].forEach(property => {
el.maskStyle[property] = el.getBoundingClientRect()[property] + document.body[`scroll${ property[0].toUpperCase() + property.slice(1) }`] + 'px';
let scroll = property === 'top' ? 'scrollTop' : 'scrollLeft';
el.maskStyle[property] = el.getBoundingClientRect()[property] + document.body[scroll] + document.documentElement[scroll] + 'px';
});
['height', 'width'].forEach(property => {
el.maskStyle[property] = el.getBoundingClientRect()[property] + 'px';
......
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