Skip to content

Commit

Permalink
a11y
Browse files Browse the repository at this point in the history
  • Loading branch information
Clararigaud committed Sep 21, 2024
1 parent 47551bc commit 4df4d76
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
11 changes: 7 additions & 4 deletions assets/js/theme/components/lightbox/container.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,16 @@ window.osuny.lightbox.LightboxContainer.prototype = {
},
show (lightbox) {
this._removeImageContent();
this._setImageContent(lightbox.url);
this._setImageContent(lightbox);
// maybe add description ou alt
this.content.focus();
},
_setImageContent (url) {
_setImageContent (lightbox) {
var image = document.createElement('img');
image.setAttribute('src', url);
image.setAttribute('src', lightbox.url);
if (lightbox.description) {
image.setAttribute('alt', lightbox.description);
}
this.content.append(image);
},
_removeImageContent () {
Expand All @@ -48,7 +51,7 @@ window.osuny.lightbox.LightboxContainer.prototype = {
this.footerElement.inert = true;
this.footerElement.setAttribute('aria-hidden', 'true');
},
_enablePageElement() {
_enablePageElement () {
this.mainElement.inert = false;
this.mainElement.setAttribute('aria-hidden', 'false');
this.headerElement.inert = false;
Expand Down
4 changes: 2 additions & 2 deletions layouts/partials/commons/lightbox/lightbox-container.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="lightbox-container">
<div class="lightbox-content">
</div>
<figure role='figure' class="lightbox-content">
</figure>
<div class="lightbox-controls">
<div class="details-window">
<div>
Expand Down

0 comments on commit 4df4d76

Please sign in to comment.