1
0
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:
Gary Katsevman 2016-09-28 13:18:02 -04:00
parent a17de688f3
commit 282bda7e34
2 changed files with 2 additions and 2 deletions

View File

@ -2,7 +2,7 @@ CHANGELOG
=========
## HEAD (Unreleased)
_(none)_
* @gkatsev checked throwIfWhitespace first in hasElClass ([view](https://github.com/videojs/video.js/pull/3640))
--------------------

View File

@ -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);
}
}