aboutsummaryrefslogtreecommitdiffstats
path: root/content_scripts
diff options
context:
space:
mode:
authorStephen Blott2017-11-25 11:37:44 +0000
committerStephen Blott2017-11-25 11:37:49 +0000
commit8f63e5fed000fcae50277e7886b828d9bc87da34 (patch)
treeb17b9e1f5ce0bf862cef28afd06c2ddb6a3e15f9 /content_scripts
parent0ecf8c01b873d08d7f477a7d32ca2d55fefc74c4 (diff)
downloadvimium-8f63e5fed000fcae50277e7886b828d9bc87da34.tar.bz2
Tweak #2783.
Tiny tweaks... 1. The test is clearer like this. 2. Use a more CoffeeScript-ish approach to sub-string.
Diffstat (limited to 'content_scripts')
-rw-r--r--content_scripts/link_hints.coffee4
1 files changed, 2 insertions, 2 deletions
diff --git a/content_scripts/link_hints.coffee b/content_scripts/link_hints.coffee
index 6be163ef..0592c96d 100644
--- a/content_scripts/link_hints.coffee
+++ b/content_scripts/link_hints.coffee
@@ -818,11 +818,11 @@ LocalHints =
nodeName = element.nodeName.toLowerCase()
if nodeName == "input"
- if element.labels?.length > 0
+ if element.labels? and element.labels.length > 0
linkText = element.labels[0].textContent.trim()
# Remove trailing ":" commonly found in labels.
if linkText[linkText.length-1] == ":"
- linkText = linkText.substr 0, linkText.length-1
+ linkText = linkText[...linkText.length-1]
showLinkText = true
else if element.getAttribute("type")?.toLowerCase() == "file"
linkText = "Choose File"