diff --git a/content/patterns/listbox/examples/js/listbox-collapsible.js b/content/patterns/listbox/examples/js/listbox-collapsible.js index 7d0e8866fc..8127141729 100644 --- a/content/patterns/listbox/examples/js/listbox-collapsible.js +++ b/content/patterns/listbox/examples/js/listbox-collapsible.js @@ -4,6 +4,8 @@ * https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document */ +/* global aria */ + 'use strict'; /** @@ -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); }); diff --git a/content/patterns/listbox/examples/js/listbox-rearrangeable.js b/content/patterns/listbox/examples/js/listbox-rearrangeable.js index 6f84726306..b6363f6ed5 100644 --- a/content/patterns/listbox/examples/js/listbox-rearrangeable.js +++ b/content/patterns/listbox/examples/js/listbox-rearrangeable.js @@ -4,6 +4,8 @@ * https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document */ +/* global aria */ + 'use strict'; /** @@ -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'), @@ -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') ); diff --git a/content/patterns/listbox/examples/js/listbox-scrollable.js b/content/patterns/listbox/examples/js/listbox-scrollable.js index e90e80aa07..5537d34f2a 100644 --- a/content/patterns/listbox/examples/js/listbox-scrollable.js +++ b/content/patterns/listbox/examples/js/listbox-scrollable.js @@ -4,6 +4,8 @@ * https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document */ +/* global aria */ + 'use strict'; /** @@ -14,5 +16,5 @@ */ window.addEventListener('load', function () { - new Listbox(document.getElementById('ss_elem_list')); + new aria.Listbox(document.getElementById('ss_elem_list')); }); diff --git a/content/patterns/listbox/examples/js/listbox.js b/content/patterns/listbox/examples/js/listbox.js index b21bbb9f1e..bcd960b2b0 100644 --- a/content/patterns/listbox/examples/js/listbox.js +++ b/content/patterns/listbox/examples/js/listbox.js @@ -6,6 +6,11 @@ 'use strict'; +/** + * @namespace aria + */ +var aria = aria || {}; + /** * @class * @description @@ -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( @@ -676,4 +681,4 @@ class Listbox { setHandleFocusChange(focusChangeHandler) { this.handleFocusChange = focusChangeHandler; } -} +}; diff --git a/content/patterns/listbox/examples/js/toolbar.js b/content/patterns/listbox/examples/js/toolbar.js index 046ae6e514..891658108f 100644 --- a/content/patterns/listbox/examples/js/toolbar.js +++ b/content/patterns/listbox/examples/js/toolbar.js @@ -6,6 +6,11 @@ 'use strict'; +/** + * @namespace aria + */ +var aria = aria || {}; + /** * @class * @description @@ -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'); @@ -113,4 +118,4 @@ class Toolbar { focusItem(element) { element.focus(); } -} +};