Skip to content

Commit edc2618

Browse files
committed
Don't use getComputedStyle() if it is not available (fake styles).
1 parent 4817368 commit edc2618

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

unpacked/extensions/MathMenu.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@
314314
if (menu.offsetWidth) menu.style.width = (menu.offsetWidth+2) + "px";
315315
var x = event.pageX, y = event.pageY;
316316
var bbox = document.body.getBoundingClientRect();
317-
var styles = window.getComputedStyle(document.body);
317+
var styles = (window.getComputedStyle ? window.getComputedStyle(document.body) : {marginLeft: "0px"});
318318
var bodyRight = bbox.right - Math.min(0,bbox.left) + parseFloat(styles.marginLeft);
319319
if (!x && !y && "clientX" in event) {
320320
x = event.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;

0 commit comments

Comments
 (0)