Commit 97abe4b5 97abe4b58af2fafd6ef36a3efa69e48607a9eb3e by Nicolas Perriault

fixed elem visibility computation method - refs #715

1 parent 9eb64d1e
......@@ -134,15 +134,20 @@
* @return Boolean
*/
this.elementVisible = function elementVisible(elem) {
var style;
try {
var comp = window.getComputedStyle(elem, null);
return comp.visibility !== 'hidden' &&
comp.display !== 'none' &&
elem.offsetHeight > 0 &&
elem.offsetWidth > 0;
style = window.getComputedStyle(elem, null);
} catch (e) {
return false;
}
var hidden = style.visibility === 'hidden' || style.display === 'none';
if (hidden) {
return false;
}
if (style.display === "inline") {
return true;
}
return elem.clientHeight > 0 && elem.clientWidth > 0;
}
/**
......