Skip to content

Commit

Permalink
Merge pull request #1 from azinasili/v1.0.0
Browse files Browse the repository at this point in the history
v1.0.0
  • Loading branch information
Azin Asili authored Apr 6, 2017
2 parents 101db47 + 5b13380 commit c678446
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
26 changes: 13 additions & 13 deletions a11ytab.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Convert a NodeList selection into an array
* Convert a NodeList selection into an array.
*
* Take a NodeList and convert it to an array
* to expose useful array methods and properties.
Expand All @@ -13,7 +13,7 @@ function _queryToArray(el, ctx = document) {
}

/**
* Get the closest element of a given element
* Get the closest element of a given element.
*
* Take an element (the first param), and traverse the DOM upward
* from it until it finds the given element (second parameter).
Expand All @@ -33,7 +33,7 @@ function _closestEl(el, parentEl) {
}

/**
* Combine two objects based on properties
* Combine two objects based on properties.
*
* @param {Object} source - Object with original properties
* @param {Object} override - Object to override source properties
Expand All @@ -50,7 +50,7 @@ function _extendDefaults(source, override) {
}

/**
* Get current previous, and next index based on selected element
* Get current previous, and next index based on selected element.
*
* Take an array of elements and return the index of an item(s).
*
Expand Down Expand Up @@ -89,7 +89,7 @@ function _findIndex(list) {
}

/**
* Create a new A11yTab instance
* Create a new A11yTab instance.
*
* @class A11yTab
* @param {HTMLElement} selector - Element to initialise A11yTab
Expand All @@ -99,7 +99,7 @@ function _findIndex(list) {
function A11yTab(selector, options) {

/**
* Default options used in a11ytab
* Default options used in A11yTab.
*/
const defaults = {
tabList: '.a11ytab-list',
Expand All @@ -119,8 +119,8 @@ function A11yTab(selector, options) {
let settings;

/**
* If options object passed to a11ytab
* Combine options with defaults
* If options object passed to A11yTab
* Combine options with defaults.
*/
if (options && typeof options == 'object') {
settings = _extendDefaults(defaults, options);
Expand All @@ -145,7 +145,7 @@ function A11yTab(selector, options) {

/**
* Find if tab should be focused on inititalization
* If no tab is defaulted, focus on first tab
* If no tab is defaulted, focus on first tab.
*/
for (let i = 0; i < tabs.length; i++) {
if (tabs[i].classList.contains(buttonFocus)) {
Expand All @@ -162,7 +162,7 @@ function A11yTab(selector, options) {
* @method
*/
function init() {
_addAlly();
_addARIA();
_disableTab();
_disablePanel();
_activateTab(selected, focusOnLoad);
Expand All @@ -177,7 +177,7 @@ function A11yTab(selector, options) {
* @method
*/
function destroy() {
_removeAlly();
_removeARIA();
_removeEvents();
}

Expand Down Expand Up @@ -230,7 +230,7 @@ function A11yTab(selector, options) {
*
* @func
*/
function _addAlly() {
function _addARIA() {
listContainer.forEach((container) => {
container.setAttribute('role', 'tablist');
});
Expand Down Expand Up @@ -261,7 +261,7 @@ function A11yTab(selector, options) {
*
* @func
*/
function _removeAlly() {
function _removeARIA() {
listContainer.forEach((container) => {
container.removeAttribute('role');
});
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "a11ytab",
"version": "0.0.1",
"version": "1.0.0",
"description": "A fully accessible and customizable tabs front-end component.",
"homepage": "https://github.com/azinasili/a11ytab",
"authors": "Azin Asili <[email protected]>",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "a11ytab",
"version": "0.0.1",
"version": "1.0.0",
"description": "A fully accessible and customizable tabs front-end component.",
"homepage": "https://github.com/azinasili/a11ytab",
"author": "Azin Asili <[email protected]>",
Expand Down

0 comments on commit c678446

Please sign in to comment.