Skip to content

Commit

Permalink
Improving UX
Browse files Browse the repository at this point in the history
  • Loading branch information
tomickigrzegorz committed Aug 22, 2020
1 parent 07f7e34 commit fa3642e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/showMore.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions sources/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class ShowMore {
btn.className = `show-${elementClass} show-more-button`;
btn.setAttribute('aria-label', aria);
btn.setAttribute('tabindex', 0);
btn.innerHTML = this.showNumber ? type + this._getNumber(element) : type;
btn.innerHTML = this.showNumber ? type + this.getNumber(element) : type;
return btn;
}

Expand Down Expand Up @@ -159,7 +159,7 @@ class ShowMore {
}

// number of hidden items
_getNumber(element) {
getNumber(element) {
const elementType = this.type === 'table' ? element.rows : element.children;

const numbersElementHidden = [].slice
Expand All @@ -178,7 +178,7 @@ class ShowMore {
target.setAttribute('aria-label', `${expandCollapse} ${ariaLabelText}`);

if (button) {
target.innerHTML = this.showNumber ? button + this._getNumber(element) : button;
target.innerHTML = this.showNumber ? button + this.getNumber(element) : button;
} else {
if (this.type === 'table') {
target.parentNode.removeChild(target);
Expand Down

0 comments on commit fa3642e

Please sign in to comment.