@ -621,12 +621,13 @@ exports.getAbsoluteTop = function (elem) {
* @ param { Element } elem
* @ param { Element } elem
* @ param { String } className
* @ param { String } className
* /
* /
exports . addClassName = function ( elem , className ) {
exports . addClassName = function ( elem , classNames ) {
var classes = elem . className . split ( ' ' ) ;
var classes = elem . className . split ( ' ' ) ;
if ( classes . indexOf ( className ) == - 1 ) {
classes . push ( className ) ; // add the class to the array
elem . className = classes . join ( ' ' ) ;
}
var newClasses = classNames . split ( ' ' ) ;
classes = classes . concat ( newClasses . filter ( function ( className ) {
return classes . indexOf ( className ) < 0 ;
} ) ) ;
elem . className = classes . join ( ' ' ) ;
} ;
} ;
/ * *
/ * *
@ -634,13 +635,13 @@ exports.addClassName = function (elem, className) {
* @ param { Element } elem
* @ param { Element } elem
* @ param { String } className
* @ param { String } className
* /
* /
exports . removeClassName = function ( elem , className ) {
exports . removeClassName = function ( elem , classNames ) {
var classes = elem . className . split ( ' ' ) ;
var classes = elem . className . split ( ' ' ) ;
var index = classes . indexOf ( className ) ;
if ( index != - 1 ) {
classes . splice ( index , 1 ) ; // remove the class from the array
elem . className = classes . join ( ' ' ) ;
}
var oldClasses = classNam es . split ( ' ' ) ;
classes = classes . filter ( function ( className ) {
return oldClasses . indexOf ( className ) < 0 ;
} ) ;
elem . className = classes . join ( ' ' ) ;
} ;
} ;
/ * *
/ * *