aboutsummaryrefslogtreecommitdiffstats
path: root/content_scripts
diff options
context:
space:
mode:
authormrmr19932014-12-18 13:29:46 +0000
committermrmr19932014-12-18 13:30:14 +0000
commit93a5a571cc06087b2abfe383424c2fcc6ef02358 (patch)
tree983e2f207a9b9083e72a08549ade6ebaa2093dd6 /content_scripts
parent845fd65e1c1a52329352f5068e3c7f0ef7b26154 (diff)
downloadvimium-93a5a571cc06087b2abfe383424c2fcc6ef02358.tar.bz2
Split textarea and input detection in link hints
Diffstat (limited to 'content_scripts')
-rw-r--r--content_scripts/link_hints.coffee11
1 files changed, 7 insertions, 4 deletions
diff --git a/content_scripts/link_hints.coffee b/content_scripts/link_hints.coffee
index 27402250..95026cba 100644
--- a/content_scripts/link_hints.coffee
+++ b/content_scripts/link_hints.coffee
@@ -168,12 +168,15 @@ LinkHints =
switch tagName
when "a"
isClickable = true
- when "textarea", "input"
- unless (tagName == "input" and element.getAttribute("type")?.toLowerCase() == "hidden") or
- element.disabled or (element.readOnly and DomUtils.isSelectable element)
+ when "textarea"
+ isClickable = not element.disabled and not element.readOnly
+ when "input"
+ unless element.getAttribute("type")?.toLowerCase() == "hidden" or
+ element.disabled or
+ (element.readOnly and DomUtils.isSelectable element)
isClickable = true
when "button", "select"
- isClickable = not element.disabled
+ isClickable = true unless element.disabled
continue unless isClickable # If the element isn't clickable, do nothing.
clientRect = DomUtils.getVisibleClientRect element