Skip to content

Commit

Permalink
feat: added titles a11y in buttons of uc-activity-header
Browse files Browse the repository at this point in the history
  • Loading branch information
egordidenko committed Oct 4, 2024
1 parent d0bb581 commit 6827b7c
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
9 changes: 7 additions & 2 deletions blocks/CameraSource/CameraSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ export class CameraSource extends UploaderBlock {

CameraSource.template = /* HTML */ `
<uc-activity-header>
<button type="button" class="uc-mini-btn" set="onclick: *historyBack">
<button type="button" class="uc-mini-btn" set="onclick: *historyBack" l10n="@title:back">
<uc-icon name="back"></uc-icon>
</button>
<div set="@hidden: !cameraSelectHidden">
Expand All @@ -227,7 +227,12 @@ CameraSource.template = /* HTML */ `
set="$.options: cameraSelectOptions; @hidden: cameraSelectHidden; onchange: onCameraSelectChange"
>
</uc-select>
<button type="button" class="uc-mini-btn uc-close-btn" set="onclick: *closeModal">
<button
type="button"
class="uc-mini-btn uc-close-btn"
set="onclick: *closeModal"
l10n="@title:a11y-activity-header-button-close"
>
<uc-icon name="close"></uc-icon>
</button>
</uc-activity-header>
Expand Down
9 changes: 7 additions & 2 deletions blocks/ExternalSource/ExternalSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,14 +249,19 @@ export class ExternalSource extends UploaderBlock {

ExternalSource.template = /* HTML */ `
<uc-activity-header>
<button type="button" class="uc-mini-btn" set="onclick: *historyBack">
<button type="button" class="uc-mini-btn" set="onclick: *historyBack" l10n="@title:back">
<uc-icon name="back"></uc-icon>
</button>
<div>
<uc-icon set="@name: activityIcon"></uc-icon>
<span>{{activityCaption}}</span>
</div>
<button type="button" class="uc-mini-btn uc-close-btn" set="onclick: *historyBack">
<button
type="button"
class="uc-mini-btn uc-close-btn"
set="onclick: *historyBack"
l10n="@title:a11y-activity-header-button-close"
>
<uc-icon name="close"></uc-icon>
</button>
</uc-activity-header>
Expand Down
3 changes: 0 additions & 3 deletions blocks/Icon/Icon.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ export class Icon extends Block {
...this.init$,
name: '',
href: '',
title: '',
};
}

Expand All @@ -33,12 +32,10 @@ export class Icon extends Block {

Icon.template = /* HTML */ `
<svg ref="svg" xmlns="http://www.w3.org/2000/svg">
<title>{{title}}</title>
<use set="@href: href;"></use>
</svg>
`;

Icon.bindAttributes({
name: 'name',
title: 'title',
});
9 changes: 7 additions & 2 deletions blocks/UrlSource/UrlSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,19 @@ export class UrlSource extends UploaderBlock {

UrlSource.template = /* HTML */ `
<uc-activity-header>
<button type="button" class="uc-mini-btn" set="onclick: *historyBack">
<button type="button" class="uc-mini-btn" set="onclick: *historyBack" l10n="@title:back">
<uc-icon name="back"></uc-icon>
</button>
<div>
<uc-icon name="url"></uc-icon>
<span l10n="caption-from-url"></span>
</div>
<button type="button" class="uc-mini-btn uc-close-btn" set="onclick: *closeModal">
<button
type="button"
class="uc-mini-btn uc-close-btn"
set="onclick: *closeModal"
l10n="@title:a11y-activity-header-button-close"
>
<uc-icon name="close"></uc-icon>
</button>
</uc-activity-header>
Expand Down

0 comments on commit 6827b7c

Please sign in to comment.