Commit aab7d18d aab7d18de1fda93e0ca1d7e0a96872e173990e69 by Marcel Duran

checking element visibility through computed styles

1 parent f8d75e2c
...@@ -546,8 +546,14 @@ ...@@ -546,8 +546,14 @@
546 */ 546 */
547 this.visible = function visible(selector) { 547 this.visible = function visible(selector) {
548 try { 548 try {
549 var el = this.findOne(selector); 549 var comp,
550 return el && el.style.visibility !== 'hidden' && el.offsetHeight > 0 && el.offsetWidth > 0; 550 el = this.findOne(selector);
551
552 if (el) {
553 comp = window.getComputedStyle(el, null);
554 return comp.visibility !== 'hidden' && comp.display !== 'none' && el.offsetHeight > 0 && el.offsetWidth > 0;
555 }
556 return false;
551 } catch (e) { 557 } catch (e) {
552 return false; 558 return false;
553 } 559 }
......