diff options
| author | jez | 2011-01-08 03:58:02 +0800 |
|---|---|---|
| committer | jez | 2011-01-08 03:58:02 +0800 |
| commit | 49ea0e29bf9a00621ec379907120b2a25a455702 (patch) | |
| tree | 6f7dae45b6c05172f48d956761510d8961defbaf | |
| parent | 9da58222dfe99d31bddf33d5c3cd0ac12d69e065 (diff) | |
| download | vimium-49ea0e29bf9a00621ec379907120b2a25a455702.tar.bz2 | |
Reduce nesting in getVisibleClickableElements.
| -rw-r--r-- | linkHints.js | 14 |
1 files 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; } } } |
