diff options
Diffstat (limited to 'content_scripts/link_hints.coffee')
| -rw-r--r-- | content_scripts/link_hints.coffee | 19 | 
1 files changed, 18 insertions, 1 deletions
| diff --git a/content_scripts/link_hints.coffee b/content_scripts/link_hints.coffee index 15af15c5..54c10284 100644 --- a/content_scripts/link_hints.coffee +++ b/content_scripts/link_hints.coffee @@ -127,7 +127,7 @@ class LinkHintsMode    # Creates a link marker for the given link.    #    createMarkerFor: (link) -> -    marker = document.createElement("div") +    marker = DomUtils.createElement "div"      marker.className = "vimiumReset internalVimiumHintMarker vimiumHintMarker"      marker.clickableItem = link.element @@ -167,6 +167,23 @@ 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. +    @checkForAngularJs ?= do -> +      angularElements = document.getElementsByClassName "ng-scope" +      if angularElements.length == 0 +        -> false +      else +        ngAttributes = [] +        for prefix in [ '', 'data-', 'x-' ] +          for separator in [ '-', ':', '_' ] +            ngAttributes.push "#{prefix}ng#{separator}click" +        (element) -> +          for attribute in ngAttributes +            return true if element.hasAttribute attribute +          false + +    isClickable ||= @checkForAngularJs element +      # Check for attributes that make an element clickable regardless of its tagName.      if (element.hasAttribute("onclick") or          element.getAttribute("role")?.toLowerCase() in ["button", "link"] or | 
