Skip to content

Commit 74b576f

Browse files
committed
Cleanup
1 parent 08d25e3 commit 74b576f

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

src/web/assets/cp/dist/cp.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/web/assets/cp/dist/cp.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/web/assets/cp/src/js/BaseElementIndexView.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Craft.BaseElementIndexView = Garnish.Base.extend(
7979

8080
for (let i = 0; i < $(ev.elements).length; i++) {
8181
const $element = $(ev.elements).eq(i);
82-
this.enableWidgets($element);
82+
this.enableFocusableElements($element);
8383
}
8484
};
8585

@@ -88,7 +88,7 @@ Craft.BaseElementIndexView = Garnish.Base.extend(
8888

8989
for (let i = 0; i < $(ev.elements).length; i++) {
9090
const $element = $(ev.elements).eq(i);
91-
this.disableWidgets($element);
91+
this.disableFocusableElements($element);
9292
}
9393
};
9494

@@ -171,8 +171,8 @@ Craft.BaseElementIndexView = Garnish.Base.extend(
171171
'aria-checked': 'true',
172172
});
173173

174-
// remove checkbox other widgets from tab order
175-
this.disableWidgets($element);
174+
// remove other focusable elements from the tab order
175+
this.disableFocusableElements($element);
176176
continue;
177177
}
178178

@@ -202,34 +202,34 @@ Craft.BaseElementIndexView = Garnish.Base.extend(
202202
},
203203

204204
/**
205-
* Removes all interactive widgets inside the element from the focus order
206-
* @param $element
205+
* Removes all focusable elements inside the given container from the focus order
206+
* @param $container
207207
*/
208-
disableWidgets: function ($element) {
208+
disableFocusableElements: function ($container) {
209209
const disabledAttributes = {
210210
tabindex: '-1',
211-
'data-widget': true,
211+
'data-focusable': true,
212212
};
213213
// Disable all focusable elements inside the disabled elements
214-
const $focusable = Garnish.getKeyboardFocusableElements($element);
214+
const $focusable = Garnish.getKeyboardFocusableElements($container);
215215

216216
if ($focusable.length) {
217217
$focusable.attr(disabledAttributes);
218218
}
219-
this.getElementCheckbox($element).attr(disabledAttributes);
219+
this.getElementCheckbox($container).attr(disabledAttributes);
220220
},
221221

222222
/**
223-
* Moves all interactive widgets inside the element into the default focus order
224-
* @param $element
223+
* Moves all focusable elements inside the given container into the default focus order
224+
* @param $container
225225
*/
226-
enableWidgets: function ($element) {
227-
const $disabledWidgets = $element.find('[data-widget]');
226+
enableFocusableElements: function ($container) {
227+
const $focusableElements = $container.find('[data-focusable]');
228228

229-
if (!$disabledWidgets.length) return;
229+
if (!$focusableElements.length) return;
230230

231-
$disabledWidgets.removeAttr('tabindex data-widget');
232-
this.getElementCheckbox($element).attr('tabindex', '0');
231+
$focusableElements.removeAttr('tabindex data-focusable');
232+
this.getElementCheckbox($container).attr('tabindex', '0');
233233
},
234234

235235
canSelectElement: function ($element) {

0 commit comments

Comments
 (0)