Skip to content

Commit

Permalink
Merge pull request #1753 from BladeRunnerJS/bugfix/1752/ElementUtilit…
Browse files Browse the repository at this point in the history
…y-to-work-with-SVG-elements

replace use of element.className.match with element.classList.contain…
  • Loading branch information
thecapdan authored Dec 8, 2016
2 parents 155ddd8 + b413aa5 commit 1b43a3e
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,7 @@ ElementUtility.getElementsByClassName = function(domElement, tagName, className)
* @returns {DOMElement} The ancestor element with the specified class, or null.
*/
ElementUtility.getAncestorElementWithClass = function(element, className) {
var classMatcher = new RegExp("(^| )" + className + "($| )");

while (!element.className || !element.className.match(classMatcher)) {
while (!element.className || !element.classList.contains(className)) {
if (!element.parentNode) {
return null;
}
Expand Down

0 comments on commit 1b43a3e

Please sign in to comment.