Skip to content

Adds announcements for loading spinners in NestedElementManager, MatrixInput, and CategoryIndex #16417

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

Merged
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
1 change: 1 addition & 0 deletions CHANGELOG-WIP.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
- Improved the accessibility of the Craft Support widget. ([#16293]](https://github.com/craftcms/cms/pull/16293))
- Improved the accessibility of field translatable indicators and tooltips.
- Progress bars now announce their progress to screen readers. ([#16398](https://github.com/craftcms/cms/pull/16398))
- Loading spinners within element indexes and inline-editable Matrix fields are now announced to screen readers. ([#16417](https://github.com/craftcms/cms/pull/16417))

### Administration
- Added the “Affiliated Site” native user field. ([#16174](https://github.com/craftcms/cms/pull/16174))
Expand Down
2 changes: 1 addition & 1 deletion src/web/assets/cp/dist/cp.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/web/assets/cp/dist/cp.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/web/assets/cp/src/js/CategoryIndex.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ Craft.CategoryIndex = Craft.BaseElementIndex.extend({
}

this.$newCategoryBtn.addClass('loading');
Craft.cp.announce(Craft.t('app', 'Loading'));

Craft.sendActionRequest('POST', 'elements/create', {
data: {
Expand Down
2 changes: 2 additions & 0 deletions src/web/assets/cp/src/js/NestedElementManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@ Craft.NestedElementManager = Garnish.Base.extend(
createElement: async function (attributes) {
if (this.$createBtn) {
this.$createBtn.addClass('loading');
Craft.cp.announce(Craft.t('app', 'Loading'));
}

try {
Expand Down Expand Up @@ -550,6 +551,7 @@ Craft.NestedElementManager = Garnish.Base.extend(
async addElementCard(element) {
if (this.$createBtn) {
this.$createBtn.addClass('loading');
Craft.cp.announce(Craft.t('app', 'Loading'));
}

let response;
Expand Down
2 changes: 1 addition & 1 deletion src/web/assets/matrix/dist/MatrixInput.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/web/assets/matrix/dist/MatrixInput.js.map

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions src/web/assets/matrix/src/MatrixInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@

this.addListener(this.$addEntryBtn, 'activate', async function () {
this.$addEntryBtn.addClass('loading');
Craft.cp.announce(Craft.t('app', 'Loading'));
try {
await this.addEntry(this.$addEntryBtn.data('type'));
} finally {
Expand All @@ -129,6 +130,7 @@
.$container.find('button')
.on('activate', async (ev) => {
this.$addEntryMenuBtn.addClass('loading');
Craft.cp.announce(Craft.t('app', 'Loading'));
try {
await this.addEntry($(ev.currentTarget).data('type'));
} finally {
Expand Down