Skip to content
Snippets Groups Projects
Verified Commit 378f477a authored by Théodore Biadala's avatar Théodore Biadala
Browse files

Issue #3419763 by Tom Konda: Replace deprecated String.prototype.substr() with...

Issue #3419763 by Tom Konda: Replace deprecated String.prototype.substr() with String.prototype.substring()
parent ffcce9c6
No related branches found
No related tags found
No related merge requests found
......@@ -295,7 +295,7 @@
} else {
url = window.location;
}
const hash = url.hash.substr(1);
const hash = url.hash.substring(1);
if (hash) {
const $target = $(`#${hash}`);
$('body').trigger('formFragmentLinkClickOrHashChange', [$target]);
......
......@@ -637,7 +637,7 @@
// Redirect on hash change when the original hash has an associated CKEditor 5.
function redirectTextareaFragmentToCKEditor5Instance() {
const hash = window.location.hash.substr(1);
const hash = window.location.hash.substring(1);
const element = document.getElementById(hash);
if (element) {
const editorID = getElementId(element);
......
......@@ -106,7 +106,7 @@
const chars = ['#', '?', '&'];
for (let i = 0; i < chars.length; i++) {
if (href.includes(chars[i])) {
href = href.substr(0, href.indexOf(chars[i]));
href = href.substring(0, href.indexOf(chars[i]));
}
}
return href;
......
......@@ -194,7 +194,7 @@
$(once('views-ajax', '#views-tabset a')).on('click', function () {
const href = $(this).attr('href');
// Cut of #views-tabset.
const displayId = href.substr(11);
const displayId = href.substring(11);
const viewsPreviewId = document.querySelector(
'#views-live-preview #preview-display-id',
);
......
......@@ -221,7 +221,7 @@
this.target.each(function (i) {
// Ensure that the maxlength is not exceeded by prepopulating the field.
const maxlength = $(this).attr('maxlength') - suffix.length;
this.value = transliterated.substr(0, maxlength) + suffix;
this.value = transliterated.substring(0, maxlength) + suffix;
});
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment