adds text for screen readers on toggle comments

This commit is contained in:
Alberto Garcia Cabeza
2016-12-05 14:26:54 +01:00
parent dd406cfeb0
commit ae12848e23
4 changed files with 5 additions and 1 deletions

View File

@@ -52,5 +52,6 @@ App.Comments =
children_container_id = "#{$(this).data().id}_children" children_container_id = "#{$(this).data().id}_children"
$("##{children_container_id}").toggle('slow') $("##{children_container_id}").toggle('slow')
App.Comments.toggle_arrow(children_container_id) App.Comments.toggle_arrow(children_container_id)
$(this).children('.js-child-toggle').toggle()
false false
) )

View File

@@ -74,7 +74,8 @@
<% if comment.children.size > 0 %> <% if comment.children.size > 0 %>
<%= link_to "", class: "js-toggle-children relative", data: {'id': "#{dom_id(comment)}"} do %> <%= link_to "", class: "js-toggle-children relative", data: {'id': "#{dom_id(comment)}"} do %>
<span class="sr-only"><%= t("shared.show") %></span> <span class="sr-only js-child-toggle" style="display: none;"><%= t("shared.show") %></span>
<span class="sr-only js-child-toggle"><%= t("shared.hide") %></span>
<span id="<%= dom_id(comment) %>_children_arrow" class="icon-arrow-down"></span> <%= t("comments.comment.responses", count: comment.children.size) %> <span id="<%= dom_id(comment) %>_children_arrow" class="icon-arrow-down"></span> <%= t("comments.comment.responses", count: comment.children.size) %>
<% end %> <% end %>
<% else %> <% else %>

View File

@@ -426,6 +426,7 @@ en:
check_none: None check_none: None
collective: Collective collective: Collective
flag: Flag as inappropriate flag: Flag as inappropriate
hide: Hide
print: print:
print_button: Print this info print_button: Print this info
show: Show show: Show

View File

@@ -426,6 +426,7 @@ es:
check_none: Ninguno check_none: Ninguno
collective: Colectivo collective: Colectivo
flag: Denunciar como inapropiado flag: Denunciar como inapropiado
hide: Ocultar
print: print:
print_button: Imprimir esta información print_button: Imprimir esta información
show: Mostrar show: Mostrar