diff options
| author | Daniel Skogly | 2015-06-20 11:51:53 +0200 |
|---|---|---|
| committer | Daniel Skogly | 2015-06-20 11:51:53 +0200 |
| commit | 26547bc1f17df068ae131b512f5419cb2aefecb0 (patch) | |
| tree | 7aaa2f38e3b4346399edd1f589810a122d78fb50 | |
| parent | 1042251c210b22036c3a847df46b1c44b7d87cfe (diff) | |
| download | vimium-26547bc1f17df068ae131b512f5419cb2aefecb0.tar.bz2 | |
Tweaks
In regards to https://github.com/philc/vimium/commit/9475c51932fc3331e515886b0495c5b86a1a9e65
| -rw-r--r-- | content_scripts/link_hints.coffee | 8 |
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 |
