Skip to content

Commit

Permalink
fix data-default
Browse files Browse the repository at this point in the history
jshint said to use isNaN() function instead of parseInt(setPanel) !== NaN.  but guess what, that broke this particular function!

so, instead, reverting to what worked until i can figure out why this isn’t working.
  • Loading branch information
scottaohara committed Oct 27, 2017
1 parent 7044e3a commit 2bda8a7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions assets/js/aria.accordion.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

ARIAaccordion.NS = 'ARIAaccordion';
ARIAaccordion.AUTHOR = 'Scott O\'Hara';
ARIAaccordion.VERSION = '2.0.0';
ARIAaccordion.VERSION = '2.0.1';
ARIAaccordion.LICENSE = 'https://github.com/scottaohara/accessible-components/blob/master/LICENSE.md';

var widgetTrigger = 'accordion__trigger';
Expand Down Expand Up @@ -135,7 +135,7 @@
* opened panel if a data-default value is set.
* If no value set, then no panels are open.
*/
if ( setPanel !== 'none' && isNaN(setPanel) ) {
if ( setPanel !== 'none' && parseInt(setPanel) !== NaN ) {
// if value is 1 or less
if ( setPanel <= 1 ) {
ariaHidden(panels[0], false);
Expand All @@ -156,7 +156,7 @@
* and a default open panel was not set (or was not set correctly),
* then run one more check.
*/
if ( constant && setPanel === 'none' || isNaN(setPanel) ) {
if ( constant && setPanel === 'none' || parseInt(setPanel) === NaN ) {
ariaHidden(panels[0], false);
}
}
Expand Down
2 changes: 1 addition & 1 deletion assets/js/aria.accordion.min.js

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

0 comments on commit 2bda8a7

Please sign in to comment.