Loading core/core.libraries.yml +5 −0 Original line number Diff line number Diff line Loading @@ -381,6 +381,11 @@ drupal.states: - core/once - core/jquery.once.bc drupal.string.includes: version: VERSION js: misc/polyfills/string.includes.js: { weight: -20 } drupal.tabbingmanager: version: VERSION js: Loading core/misc/polyfills/string.includes.es6.js 0 → 100644 +26 −0 Original line number Diff line number Diff line /** * @file * Provides a polyfill for String.includes(). * * This is needed for Internet Explorer 11 and Opera Mini. * * This has been copied from MDN Web Docs code samples. Code samples in the MDN * Web Docs are licensed under CC0. * * @see https://web.archive.org/web/20210916035058/https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes * @see https://developer.mozilla.org/en-US/docs/MDN/About#Code_samples_and_snippets */ /* eslint-disable strict, lines-around-directive, no-extend-native */ if (!String.prototype.includes) { String.prototype.includes = function (search, start) { 'use strict'; if (search instanceof RegExp) { throw TypeError('first argument must not be a RegExp'); } if (start === undefined) { start = 0; } return this.indexOf(search, start) !== -1; }; } core/misc/polyfills/string.includes.js 0 → 100644 +22 −0 Original line number Diff line number Diff line /** * DO NOT EDIT THIS FILE. * See the following change record for more information, * https://www.drupal.org/node/2815083 * @preserve **/ if (!String.prototype.includes) { String.prototype.includes = function (search, start) { 'use strict'; if (search instanceof RegExp) { throw TypeError('first argument must not be a RegExp'); } if (start === undefined) { start = 0; } return this.indexOf(search, start) !== -1; }; } No newline at end of file core/modules/block/block.libraries.yml +1 −0 Original line number Diff line number Diff line Loading @@ -21,5 +21,6 @@ drupal.block.admin: - core/drupal.announce - core/drupal.debounce - core/drupal.dialog.ajax - core/drupal.string.includes - core/once - core/jquery.once.bc core/modules/block/js/block.admin.es6.js +1 −1 Original line number Diff line number Diff line Loading @@ -46,7 +46,7 @@ function toggleBlockEntry(index, label) { const $label = $(label); const $row = $label.parent().parent(); const textMatch = $label.text().toLowerCase().indexOf(query) !== -1; const textMatch = $label.text().toLowerCase().includes(query); $row.toggle(textMatch); } Loading Loading
core/core.libraries.yml +5 −0 Original line number Diff line number Diff line Loading @@ -381,6 +381,11 @@ drupal.states: - core/once - core/jquery.once.bc drupal.string.includes: version: VERSION js: misc/polyfills/string.includes.js: { weight: -20 } drupal.tabbingmanager: version: VERSION js: Loading
core/misc/polyfills/string.includes.es6.js 0 → 100644 +26 −0 Original line number Diff line number Diff line /** * @file * Provides a polyfill for String.includes(). * * This is needed for Internet Explorer 11 and Opera Mini. * * This has been copied from MDN Web Docs code samples. Code samples in the MDN * Web Docs are licensed under CC0. * * @see https://web.archive.org/web/20210916035058/https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes * @see https://developer.mozilla.org/en-US/docs/MDN/About#Code_samples_and_snippets */ /* eslint-disable strict, lines-around-directive, no-extend-native */ if (!String.prototype.includes) { String.prototype.includes = function (search, start) { 'use strict'; if (search instanceof RegExp) { throw TypeError('first argument must not be a RegExp'); } if (start === undefined) { start = 0; } return this.indexOf(search, start) !== -1; }; }
core/misc/polyfills/string.includes.js 0 → 100644 +22 −0 Original line number Diff line number Diff line /** * DO NOT EDIT THIS FILE. * See the following change record for more information, * https://www.drupal.org/node/2815083 * @preserve **/ if (!String.prototype.includes) { String.prototype.includes = function (search, start) { 'use strict'; if (search instanceof RegExp) { throw TypeError('first argument must not be a RegExp'); } if (start === undefined) { start = 0; } return this.indexOf(search, start) !== -1; }; } No newline at end of file
core/modules/block/block.libraries.yml +1 −0 Original line number Diff line number Diff line Loading @@ -21,5 +21,6 @@ drupal.block.admin: - core/drupal.announce - core/drupal.debounce - core/drupal.dialog.ajax - core/drupal.string.includes - core/once - core/jquery.once.bc
core/modules/block/js/block.admin.es6.js +1 −1 Original line number Diff line number Diff line Loading @@ -46,7 +46,7 @@ function toggleBlockEntry(index, label) { const $label = $(label); const $row = $label.parent().parent(); const textMatch = $label.text().toLowerCase().indexOf(query) !== -1; const textMatch = $label.text().toLowerCase().includes(query); $row.toggle(textMatch); } Loading