Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BSW-2973 rendre le label du bouton de recherche traduisible #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions assets/src/js/normes.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,9 @@ var closeMainMenu = function () {
var closeMainSearch = function () {
document.querySelector(".header-search").classList.remove("open");
document.removeEventListener("keydown", detectBackTabOnSearchBar);
document
.querySelector(".header-search-trigger")
.setAttribute("aria-expanded", "false");
document
.querySelector(".header-search-trigger")
.setAttribute("aria-label", "Ouvrir le menu de recherche");
let trigger = document.querySelector(".header-search-trigger");
trigger.setAttribute("aria-expanded", "false")
trigger.setAttribute("aria-label", trigger.getAttribute("data-open-search-label"));
};

// Fermeture du moteur de recherche
Expand Down Expand Up @@ -121,7 +118,7 @@ if ((searchBarButton = document.querySelector(".header-search-trigger"))) {
document.querySelector(".header-search-input").focus();
document.addEventListener("keydown", detectBackTabOnSearchBar);
this.setAttribute("aria-expanded", "true");
this.setAttribute("aria-label", "Fermer le menu de recherche");
this.setAttribute("aria-label", this.getAttribute("data-close-search-label"));
} else {
closeMainSearch();
}
Expand Down
2 changes: 1 addition & 1 deletion subunit.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
</nav>

<div class="header-main-utilities">
<button type="button" class="header-search-trigger header-main-utilities-action" aria-expanded="false" aria-controls="header-search" aria-label="Ouvrir le menu de recherche">
<button type="button" class="header-search-trigger header-main-utilities-action" aria-expanded="false" aria-controls="header-search" data-open-search-label="Ouvrir le menu de recherche" data-close-search-label="Fermer le menu de recherche" aria-label="Ouvrir le menu de recherche">
<span class="switch-toggle switch-toggle--close">
<!-- @TODO: Include this SVG as an inline SVG -->
<!-- ./assets/dist/svg/close.svg -->
Expand Down
2 changes: 1 addition & 1 deletion unit--no-submenu.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
</nav>

<div class="header-main-utilities">
<button type="button" class="header-search-trigger header-main-utilities-action" aria-expanded="false" aria-controls="header-search" aria-label="Ouvrir le menu de recherche">
<button type="button" class="header-search-trigger header-main-utilities-action" aria-expanded="false" aria-controls="header-search" data-open-search-label="Ouvrir le menu de recherche" data-close-search-label="Fermer le menu de recherche" aria-label="Ouvrir le menu de recherche">
<span class="switch-toggle switch-toggle--close">
<!-- @TODO: Include this SVG as an inline SVG -->
<!-- ./assets/dist/svg/close.svg -->
Expand Down
4 changes: 2 additions & 2 deletions unit--with-submenu.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
</nav>

<div class="header-main-utilities">
<button type="button" class="header-search-trigger header-main-utilities-action" aria-expanded="false" aria-controls="header-search" aria-label="Chercher">
<button type="button" class="header-search-trigger header-main-utilities-action" aria-expanded="false" aria-controls="header-search" data-open-search-label="Ouvrir le menu de recherche" data-close-search-label="Fermer le menu de recherche" aria-label="Ouvrir le menu de recherche">
<span class="switch-toggle switch-toggle--close">
<!-- @TODO: Include this SVG as an inline SVG -->
<!-- ./assets/dist/svg/close.svg -->
Expand Down Expand Up @@ -252,7 +252,7 @@
<div class="header-search-main">
<label for="header-search-input" tabindex="-1" class="visually-hidden">Que cherchez-vous?</label>
<input id="header-search-input" tabindex="0" class="header-search-input" type="search" placeholder="Chercher par mots-clés" name="q" value="" />
<button class="header-search-button" tabindex="0" type="submit" value="" aria-label="Ouvrir le menu de recherche">
<button class="header-search-button" tabindex="0" type="submit" value="" aria-label="Chercher">
<!-- @TODO: Include this SVG as an inline SVG -->
<!-- ./assets/dist/svg/search.svg -->
<svg aria-hidden="true" aria-role="presentation" class="search" viewBox="0 0 32 32">
Expand Down
2 changes: 1 addition & 1 deletion university.html
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
</nav>

<div class="header-main-utilities">
<button type="button" class="header-search-trigger header-main-utilities-action" aria-expanded="false" aria-controls="header-search" aria-label="Ouvrir le menu de recherche">
<button type="button" class="header-search-trigger header-main-utilities-action" aria-expanded="false" aria-controls="header-search" data-open-search-label="Ouvrir le menu de recherche" data-close-search-label="Fermer le menu de recherche" aria-label="Ouvrir le menu de recherche">
<span class="switch-toggle switch-toggle--close">
<!-- @TODO: Include this SVG as an inline SVG -->
<!-- ./assets/dist/svg/close.svg -->
Expand Down