From 26547bc1f17df068ae131b512f5419cb2aefecb0 Mon Sep 17 00:00:00 2001 From: Daniel Skogly Date: Sat, 20 Jun 2015 11:51:53 +0200 Subject: Tweaks In regards to https://github.com/philc/vimium/commit/9475c51932fc3331e515886b0495c5b86a1a9e65--- content_scripts/link_hints.coffee | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'content_scripts') 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 -- cgit v1.2.3