diff options
| author | jez | 2011-01-04 17:40:03 +0800 |
|---|---|---|
| committer | jez | 2011-01-04 17:40:03 +0800 |
| commit | b147585e1f8509d457bc567e77203ae303b5cfa7 (patch) | |
| tree | 13b9c107b6a99143cb921f5b46a53b712d4208bd /linkHints.js | |
| parent | 92a0c80a4820689b14aaf1b7f0dda59de9417ac7 (diff) | |
| download | vimium-b147585e1f8509d457bc567e77203ae303b5cfa7.tar.bz2 | |
Fix filter hinting for images, and added corresponding test.
Also refactored the test page a little.
Diffstat (limited to 'linkHints.js')
| -rw-r--r-- | linkHints.js | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/linkHints.js b/linkHints.js index 09bd2550..c5ad6066 100644 --- a/linkHints.js +++ b/linkHints.js @@ -460,11 +460,10 @@ function initializeLinkHints() { } else if (nodeName == "a" && !element.textContent.trim() && element.firstElementChild && element.firstElementChild.nodeName.toLowerCase() == "img") { - showLinkText = true; linkText = element.firstElementChild.alt || element.firstElementChild.title; - } - - if (!linkText) { + if (linkText) + showLinkText = true; + } else { linkText = element.textContent || element.innerHTML; } linkText = linkText.trim().toLowerCase(); |
