diff options
| author | Daniel Skogly | 2015-06-18 13:09:55 +0200 | 
|---|---|---|
| committer | Daniel Skogly | 2015-06-18 13:09:55 +0200 | 
| commit | 2ea38efb65759a6a396bec7134c65880e71f9bcb (patch) | |
| tree | e9d887bfab051f5b3b86f9788229df58ec01ec55 | |
| parent | f7c1431c1f9bbd7f40934fe32f30449cd81f99a3 (diff) | |
| download | vimium-2ea38efb65759a6a396bec7134c65880e71f9bcb.tar.bz2 | |
Proper function definition
Changed from : to =
| -rw-r--r-- | content_scripts/link_hints.coffee | 27 | 
1 files changed, 14 insertions, 13 deletions
| diff --git a/content_scripts/link_hints.coffee b/content_scripts/link_hints.coffee index 770a4639..1f15bfe8 100644 --- a/content_scripts/link_hints.coffee +++ b/content_scripts/link_hints.coffee @@ -166,25 +166,26 @@ class LinkHintsMode      if (element.getAttribute("aria-hidden")?.toLowerCase() in ["", "true"] or          element.getAttribute("aria-disabled")?.toLowerCase() in ["", "true"])        return [] # This element should never have a link hint. -       -      # checks for every valid version of ng-click -      ngPrefixes = ['', 'data-', 'x-'] -      ngSeparators = ['-', ':', '_'] -      ng = 'ng' -      click = 'click' -      hasNgClick: (element) -> -        for prefix in ngPrefixes -          for separator in ngSeparators -            attr = prefix + ng + separator + click -            if element.attributes.hasOwnProperty(attr) -              return true + +    # checks for every valid version of ng-click +    ngPrefixes = ['', 'data-', 'x-'] +    ngSeparators = ['-', ':', '_'] +    ng = 'ng' +    click = 'click' +    hasNgClick = () -> +      for prefix in ngPrefixes +        for separator in ngSeparators +          attr = prefix + ng + separator + click +          if element.attributes.hasOwnProperty(attr) +            return true +      return false      # 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          element.getAttribute("class")?.toLowerCase().indexOf("button") >= 0 or          element.getAttribute("contentEditable")?.toLowerCase() in ["", "contentEditable", "true"]) or -        hasNgClick element +        hasNgClick         isClickable = true      # Check for jsaction event listeners on the element. | 
