mirror of
https://github.com/videojs/video.js.git
synced 2025-01-13 10:32:26 +02:00
@gkatsev checked throwIfWhitespace first in hasElClass. closes #3640
This commit is contained in:
parent
a17de688f3
commit
282bda7e34
@ -2,7 +2,7 @@ CHANGELOG
|
||||
=========
|
||||
|
||||
## HEAD (Unreleased)
|
||||
_(none)_
|
||||
* @gkatsev checked throwIfWhitespace first in hasElClass ([view](https://github.com/videojs/video.js/pull/3640))
|
||||
|
||||
--------------------
|
||||
|
||||
|
@ -240,10 +240,10 @@ export function removeElData(el) {
|
||||
* @param {String} classToCheck Classname to check
|
||||
*/
|
||||
export function hasElClass(element, classToCheck) {
|
||||
throwIfWhitespace(classToCheck);
|
||||
if (element.classList) {
|
||||
return element.classList.contains(classToCheck);
|
||||
} else {
|
||||
throwIfWhitespace(classToCheck);
|
||||
return classRegExp(classToCheck).test(element.className);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user