User:Terasail/Edit Request Tool.js: Difference between revisions

Content deleted Content added
m Change indentation
Add fix for Vector Legacy
Line 375:
sectionIndex = parseInt(tempElement.parentElement.dataset.mwSectionId);
} else {
header =if (tempElement.getElementsByClassName("mw-headline")[0].id;length > 0) { //Vector 2022
header = tempElement.getElementsByClassName("mw-headline")[0].id;
} else { //Vector Legacy
header = $(tempElement).find("h1,h2,h3,h4,h5,h6")[0].id;
}
for (let i = 0; i < sections.length; i++) {
if (sections[i].anchor == header) {