mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-02-06 06:54:58 +00:00
Update browser.js
This commit is contained in:
parent
a3fa1a558e
commit
98ff88ffff
|
@ -108,6 +108,36 @@ if (!window.addEventListener) {
|
||||||
})(window, document, global.Element.prototype, []);
|
})(window, document, global.Element.prototype, []);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// https://stackoverflow.com/questions/45552695/why-element-matches-polyfill-doesnt-work
|
||||||
|
// https://github.com/zloirock/core-js/issues/780
|
||||||
|
// https://github.com/joncasey/modern-hta/blob/master/src/element-closest.js
|
||||||
|
if (Element && Element.prototype) {
|
||||||
|
if (!Element.prototype.matches) {
|
||||||
|
Element.prototype.matches = Element.prototype.msMatchesSelector;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!Element.prototype.closest) {
|
||||||
|
Element.prototype.closest = function(selector) {
|
||||||
|
for (var p = this; p != null; p = p.parentElement) {
|
||||||
|
if (p.matches(selector)) return p;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// https://github.com/summernote/summernote/pull/4625
|
||||||
|
if (CanvasPixelArray && CanvasPixelArray.prototype) {
|
||||||
|
if (!CanvasPixelArray.prototype.join) {
|
||||||
|
CanvasPixelArray.prototype.join = function() {
|
||||||
|
var pxInfo = this, s = '';
|
||||||
|
for (var i = 0; i < pxInfo.length; i++) {
|
||||||
|
s += pxInfo[i].toString();
|
||||||
|
}
|
||||||
|
return s;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// getIEVersion()
|
// getIEVersion()
|
||||||
function getIEVersion() {
|
function getIEVersion() {
|
||||||
var undef,
|
var undef,
|
||||||
|
@ -254,7 +284,7 @@ exports.start = start;
|
||||||
exports.reload = reload;
|
exports.reload = reload;
|
||||||
exports.close = close;
|
exports.close = close;
|
||||||
|
|
||||||
exports.VERSIONINFO = "Browser Compatibility Library (browser.js) version 0.1.6";
|
exports.VERSIONINFO = "Browser Compatibility Layer (browser.js) version 0.1.7";
|
||||||
exports.AUTHOR = "abuse@catswords.net";
|
exports.AUTHOR = "abuse@catswords.net";
|
||||||
exports.global = global;
|
exports.global = global;
|
||||||
exports.require = global.require;
|
exports.require = global.require;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user