Skip to content

Instantly share code, notes, and snippets.

@bergatron
Created October 3, 2018 20:57
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Content Filter Controller
# 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