aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Skogly2015-06-20 11:51:53 +0200
committerDaniel Skogly2015-06-20 11:51:53 +0200
commit26547bc1f17df068ae131b512f5419cb2aefecb0 (patch)
tree7aaa2f38e3b4346399edd1f589810a122d78fb50
parent1042251c210b22036c3a847df46b1c44b7d87cfe (diff)
downloadvimium-26547bc1f17df068ae131b512f5419cb2aefecb0.tar.bz2
Tweaks
In regards to https://github.com/philc/vimium/commit/9475c51932fc3331e515886b0495c5b86a1a9e65
-rw-r--r--content_scripts/link_hints.coffee8
1 files changed, 4 insertions, 4 deletions
diff --git a/content_scripts/link_hints.coffee b/content_scripts/link_hints.coffee
index 327d622a..ba550c04 100644
--- a/content_scripts/link_hints.coffee
+++ b/content_scripts/link_hints.coffee
@@ -167,19 +167,19 @@ class LinkHintsMode
element.getAttribute("aria-disabled")?.toLowerCase() in ["", "true"])
return [] # This element should never have a link hint.
- # Check for AngularJS listeners on the element.
+ # Check for AngularJS listeners on the element. These are becoming increasingly preferred instead of
+ # Javascript's native onclick listeners.
ngPrefixes = ['', 'data-', 'x-']
ngSeparators = ['-', ':', '_']
hasNgClick = () ->
for prefix in ngPrefixes
for separator in ngSeparators
attr = "#{prefix}ng#{separator}click"
- if element.hasAttribute(attr)
+ if element.hasAttribute attr
return true
return false
- if hasNgClick()
- isClickable = true
+ isClickable ||= hasNgClick()
# Check for attributes that make an element clickable regardless of its tagName.
if (element.hasAttribute("onclick") or