Don't use getComputedStyle() if it is not available (fake styles).

This commit is contained in:
Davide P. Cervone 2016-07-12 11:50:51 -04:00
parent 4817368010
commit edc2618568

View File

@ -314,7 +314,7 @@
if (menu.offsetWidth) menu.style.width = (menu.offsetWidth+2) + "px";
var x = event.pageX, y = event.pageY;
var bbox = document.body.getBoundingClientRect();
var styles = window.getComputedStyle(document.body);
var styles = (window.getComputedStyle ? window.getComputedStyle(document.body) : {marginLeft: "0px"});
var bodyRight = bbox.right - Math.min(0,bbox.left) + parseFloat(styles.marginLeft);
if (!x && !y && "clientX" in event) {
x = event.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;