From 49ea0e29bf9a00621ec379907120b2a25a455702 Mon Sep 17 00:00:00 2001 From: jez Date: Sat, 8 Jan 2011 03:58:02 +0800 Subject: Reduce nesting in getVisibleClickableElements. --- linkHints.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/linkHints.js b/linkHints.js index 65d310b8..aba229da 100644 --- a/linkHints.js +++ b/linkHints.js @@ -149,13 +149,13 @@ var linkHintsBase = { // but floated elements. Check for this. if (clientRect && (clientRect.width == 0 || clientRect.height == 0)) { for (var j = 0; j < element.children.length; j++) { - if (window.getComputedStyle(element.children[j], null).getPropertyValue('float') != 'none') { - var childClientRect = element.children[j].getClientRects()[0]; - if (this.isVisible(element.children[j], childClientRect)) { - visibleElements.push({element: element.children[j], rect: childClientRect}); - break; - } - } + if (window.getComputedStyle(element.children[j], null).getPropertyValue('float') == 'none') + continue; + var childClientRect = element.children[j].getClientRects()[0]; + if (!this.isVisible(element.children[j], childClientRect)) + continue; + visibleElements.push({element: element.children[j], rect: childClientRect}); + break; } } } -- cgit v1.2.3