Skip to content

Commit

Permalink
[UPD] accessibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Viglino committed Feb 12, 2025
1 parent 0283fbb commit 83e9a58
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 5 deletions.
4 changes: 4 additions & 0 deletions Carte.css
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,10 @@ body > .ol-ext-dialog.mapInfo > form.ol-title .ol-content {
}

/* Popup */
.ol-popup button.closeBox:focus-visible {
outline: 2px solid currentColor;
}

.ol-popup .ol-popup-content {
max-width: min(50vw, 300px);
max-height: min(50vh, 300px);
Expand Down
14 changes: 14 additions & 0 deletions StoryMap.css
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,12 @@ button.popup-next:before {
padding: .35em .5em;
background-color: transparent;
}
[data-role="storymap"] .volet .pages .toc:focus,
[data-role="storymap"] .volet .steps button.prev:focus,
[data-role="storymap"] .volet .steps button.next:focus {
opacity: 0.8;
}

[data-role="storymap"] .volet .steps button.prev:before,
[data-role="storymap"] .volet .steps button.next:before {
content: '\f054';
Expand Down Expand Up @@ -417,6 +423,14 @@ button.popup-next:before {
padding: .1em .5em;
text-align: left;
}
[data-role="storymap"] .volet .content .toc li a {
text-decoration: none;
font-weight: inherit;
}
[data-role="storymap"] .volet .content .toc li a:focus-visible {
font-weight: bold;
text-decoration: underline;
}
[data-role="storymap"] .volet .content .toc li.active {
font-weight: bold;
}
Expand Down
8 changes: 4 additions & 4 deletions StoryMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ StoryMap.prototype.setStep = function(n, anim) {
n = Math.max(Math.min(n, this.steps.getLength()-1), 0);
this.currentStep = n;
// Create content
const div = ol_ext_element.create('DIV', {
const div = ol_ext_element.create('FORM', {
className: 'pages'
});
// Previous
Expand All @@ -700,7 +700,7 @@ StoryMap.prototype.setStep = function(n, anim) {
click: () => {
if (!this.get('freezeStep') && n>0) {
this.setStep(n-1);
prevBt.focus();
this.element.step.querySelector('button.prev').focus()
}
},
parent: div
Expand All @@ -717,7 +717,7 @@ StoryMap.prototype.setStep = function(n, anim) {
title: _T('next'),
click: () => {
if (!this.get('freezeStep') && n < this.steps.getLength() -1) this.setStep(n+1);
nextBt.focus();
this.element.step.querySelector('button.next').focus()
},
parent: div
});
Expand Down Expand Up @@ -793,7 +793,7 @@ StoryMap.prototype.showTOC = function(current) {
});
this.steps.forEach((s, i) => {
ol_ext_element.create('LI', {
html: s.title,
html: ol_ext_element.create('A', { href: '#', text: s.title, click: e => e.preventDefault() }),
className: current===i ? 'active' : '',
click: () => {
this.setStep(i, false);
Expand Down
2 changes: 1 addition & 1 deletion md/md2html.js
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,7 @@ md2html.iconize = function(md) {
* @param {Array<Feature>} features
*/
md2html.showSelection = function(parent, select, count, contents, features) {
const div = ol_ext_element.create('DIV', { className: 'ol-count', parent: parent });
const div = ol_ext_element.create('FORM', { className: 'ol-count', parent: parent });

// Show next/prev
const incShow = (ninc) => {
Expand Down

0 comments on commit 83e9a58

Please sign in to comment.