mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 09:46:28 +08:00
ui: update polyfill
This commit is contained in:
7 files changed
+44
-13
No files matched your search
@@ -17,6 +17,18 @@ if (window.MediaQueryList && !MediaQueryList.prototype.addEventListener) {
|
||||
MediaQueryList.prototype.addListener(listener);
|
||||
};
|
||||
}
|
||||
if (typeof window['WeakRef'] === 'undefined') {
|
||||
// @ts-ignore
|
||||
window.WeakRef = (function (wm) {
|
||||
function WeakRef(target) {
|
||||
wm.set(this, target);
|
||||
}
|
||||
WeakRef.prototype.deref = function () {
|
||||
return wm.get(this);
|
||||
};
|
||||
return WeakRef;
|
||||
}(new WeakMap()));
|
||||
}
|
||||
if (!(window.matchMedia('all').addListener || window.matchMedia('all').addEventListener)) {
|
||||
const localMatchMedia = window.matchMedia;
|
||||
const hasMediaQueries = localMatchMedia('only all').matches;
|
||||
|
||||
Reference in new issue
Block a user