Instantly share code, notes, and snippets.

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