redefine closest func
This commit is contained in:
@@ -13,6 +13,18 @@ let appElement = (
|
||||
);
|
||||
|
||||
if (typeof window === "object") {
|
||||
if (!window.Element.prototype.closest) {
|
||||
window.Element.prototype.closest = function(selector) {
|
||||
var element = this;
|
||||
while (element) {
|
||||
if (element.matches(selector)) {
|
||||
return element;
|
||||
}
|
||||
element = element.parentElement;
|
||||
}
|
||||
return null;
|
||||
};
|
||||
}
|
||||
window.store = store;
|
||||
|
||||
render(appElement, document.getElementById("root"));
|
||||
|
||||
Reference in New Issue
Block a user