Skip to content
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

Satisfy linter for gh-2622 #2642

Merged
merged 2 commits into from
Mar 14, 2023
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
4 changes: 3 additions & 1 deletion content/patterns/listbox/examples/js/listbox-collapsible.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
*/

/* global aria */

'use strict';

/**
Expand All @@ -15,7 +17,7 @@

window.addEventListener('load', function () {
const button = document.getElementById('exp_button');
const exListbox = new Listbox(document.getElementById('exp_elem_list'));
const exListbox = new aria.Listbox(document.getElementById('exp_elem_list'));
new ListboxButton(button, exListbox);
});

Expand Down
12 changes: 7 additions & 5 deletions content/patterns/listbox/examples/js/listbox-rearrangeable.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
*/

/* global aria */

'use strict';

/**
Expand All @@ -17,13 +19,13 @@ window.addEventListener('load', function () {
// This onload handle initializes two examples. Only initialize example if the example
// can be found in the dom.
if (document.getElementById('ss_imp_list')) {
var ex1ImportantListbox = new Listbox(
var ex1ImportantListbox = new aria.Listbox(
document.getElementById('ss_imp_list')
);
var ex1UnimportantListbox = new Listbox(
var ex1UnimportantListbox = new aria.Listbox(
document.getElementById('ss_unimp_list')
);
new Toolbar(document.querySelector('[role="toolbar"]'));
new aria.Toolbar(document.querySelector('[role="toolbar"]'));

ex1ImportantListbox.enableMoveUpDown(
document.getElementById('ex1-up'),
Expand Down Expand Up @@ -70,10 +72,10 @@ window.addEventListener('load', function () {
// This onload handle initializes two examples. Only initialize example if the example
// can be found in the dom.
if (document.getElementById('ms_imp_list')) {
var ex2ImportantListbox = new Listbox(
var ex2ImportantListbox = new aria.Listbox(
document.getElementById('ms_imp_list')
);
var ex2UnimportantListbox = new Listbox(
var ex2UnimportantListbox = new aria.Listbox(
document.getElementById('ms_unimp_list')
);

Expand Down
4 changes: 3 additions & 1 deletion content/patterns/listbox/examples/js/listbox-scrollable.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
*/

/* global aria */

'use strict';

/**
Expand All @@ -14,5 +16,5 @@
*/

window.addEventListener('load', function () {
new Listbox(document.getElementById('ss_elem_list'));
new aria.Listbox(document.getElementById('ss_elem_list'));
});
9 changes: 7 additions & 2 deletions content/patterns/listbox/examples/js/listbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@

'use strict';

/**
* @namespace aria
*/
var aria = aria || {};

/**
* @class
* @description
Expand All @@ -14,7 +19,7 @@
* The DOM node pointing to the listbox
*/

class Listbox {
aria.Listbox = class Listbox {
constructor(listboxNode) {
this.listboxNode = listboxNode;
this.activeDescendant = this.listboxNode.getAttribute(
Expand Down Expand Up @@ -676,4 +681,4 @@ class Listbox {
setHandleFocusChange(focusChangeHandler) {
this.handleFocusChange = focusChangeHandler;
}
}
};
9 changes: 7 additions & 2 deletions content/patterns/listbox/examples/js/toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@

'use strict';

/**
* @namespace aria
*/
var aria = aria || {};

/**
* @class
* @description
Expand All @@ -14,7 +19,7 @@
* The DOM node pointing to the toolbar
*/

class Toolbar {
aria.Toolbar = class Toolbar {
constructor(toolbarNode) {
this.toolbarNode = toolbarNode;
this.items = this.toolbarNode.querySelectorAll('.toolbar-item');
Expand Down Expand Up @@ -113,4 +118,4 @@ class Toolbar {
focusItem(element) {
element.focus();
}
}
};