Use === and !== instead of == and !=
This commit is contained in:
parent
79d69e7593
commit
4c99b2aba8
3 changed files with 10 additions and 10 deletions
|
@ -11,24 +11,24 @@
|
|||
return;
|
||||
|
||||
button = container.getElementsByTagName( 'h1' )[0];
|
||||
if ( 'undefined' == typeof button )
|
||||
if ( 'undefined' === typeof button )
|
||||
return;
|
||||
|
||||
menu = container.getElementsByTagName( 'ul' )[0];
|
||||
|
||||
// Hide menu toggle button if menu is empty and return early.
|
||||
if ( 'undefined' == typeof menu ) {
|
||||
if ( 'undefined' === typeof menu ) {
|
||||
button.style.display = 'none';
|
||||
return;
|
||||
}
|
||||
|
||||
if ( -1 == menu.className.indexOf( 'nav-menu' ) )
|
||||
if ( -1 === menu.className.indexOf( 'nav-menu' ) )
|
||||
menu.className += ' nav-menu';
|
||||
|
||||
button.onclick = function() {
|
||||
if ( -1 != container.className.indexOf( 'toggled' ) )
|
||||
if ( -1 !== container.className.indexOf( 'toggled' ) )
|
||||
container.className = container.className.replace( ' toggled', '' );
|
||||
else
|
||||
container.className += ' toggled';
|
||||
};
|
||||
} )();
|
||||
} )();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue