Created
October 3, 2018 20:57
-
-
Save bergatron/71f0eac50c3a8b11d3d8715819c77c58 to your computer and use it in GitHub Desktop.
Content Filter Controller
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Accessibility | |
renderAriaStatus: -> | |
@ariaStatusElement?.textContent = @setAriaStatus() | |
setAriaStatus: -> | |
if @element.query | |
if @element.matchCount == 0 | |
"No matches!" | |
else | |
"#{@getAriaStatusText()} - #{@getAriaMatchCount()}" | |
else | |
"#{@getAriaStatusText()} selected, #{@ariaDescriptionElement?.textContent}" | |
getAriaStatusText: -> | |
@selectedElement?.querySelector(selectors.ariaText).textContent.trim() | |
getAriaMatchCount: -> | |
"Match #{@element.selectedIndex + 1} of #{@element.matchCount}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment