Issue #3190268 by mherchel, bnjmnm: Move/remove JavaScript polyfills

merge-requests/411/head
catch 2021-03-10 11:15:28 +00:00
parent 5c3ac0a573
commit f407fad818
3 changed files with 2 additions and 50 deletions

View File

@ -1,29 +0,0 @@
/* eslint-disable */
/**
* From https://developer.mozilla.org/en-US/docs/Web/API/NodeList/forEach#Polyfill
* Licensed public domain (CC0).
* @see https://creativecommons.org/publicdomain/zero/1.0/
* @see https://developer.mozilla.org/en-US/docs/MDN/About
*
* @todo Remove when https://www.drupal.org/node/3143465 is fixed.
*/
if (window.NodeList && !NodeList.prototype.forEach) {
NodeList.prototype.forEach = function (callback, thisArg) {
thisArg = thisArg || window;
for (var i = 0; i < this.length; i++) {
callback.call(thisArg, this[i], i, this);
}
};
}
/**
* From https://developer.mozilla.org/en-US/docs/Web/API/Element/matches#Polyfill
* Licensed public domain (CC0).
* @see https://creativecommons.org/publicdomain/zero/1.0/
* @see https://developer.mozilla.org/en-US/docs/MDN/About
*/
if (!Element.prototype.matches) {
Element.prototype.matches =
Element.prototype.msMatchesSelector ||
Element.prototype.webkitMatchesSelector;
}

View File

@ -1,20 +0,0 @@
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
if (window.NodeList && !NodeList.prototype.forEach) {
NodeList.prototype.forEach = function (callback, thisArg) {
thisArg = thisArg || window;
for (var i = 0; i < this.length; i++) {
callback.call(thisArg, this[i], i, this);
}
};
}
if (!Element.prototype.matches) {
Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
}

View File

@ -57,11 +57,12 @@ global-styling:
js:
js/checkbox.js: {}
js/polyfills.js: {}
js/scripts.js: {}
js/navigation.js: {}
js/second-level-navigation.js: {}
dependencies:
- core/drupal.element.matches
- core/drupal.nodelist.foreach
- core/drupal
book: