mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-13 05:01:03 +00:00
Update std.js
This commit is contained in:
parent
b880e7a13d
commit
ebdc212afb
|
@ -26,12 +26,12 @@ if (!Function.prototype.GetResource) {
|
||||||
// https://github.com/joncasey/modern-hta/blob/master/src/element-closest.js
|
// https://github.com/joncasey/modern-hta/blob/master/src/element-closest.js
|
||||||
if (Element && Element.prototype) {
|
if (Element && Element.prototype) {
|
||||||
if (!Element.prototype.matches) {
|
if (!Element.prototype.matches) {
|
||||||
Element.prototype.matches = Element.prototype.msMatchesSelector
|
Element.prototype.matches = Element.prototype.msMatchesSelector;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Element.prototype.closest) {
|
if (!Element.prototype.closest) {
|
||||||
for (var p = this; p != null; p = p.parentElement) {
|
for (var p = this; p != null; p = p.parentElement) {
|
||||||
if (p.matches(selector)) return p
|
if (p.matches(selector)) return p;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user