From 54af37c2698e4dd6553d9199b67c58707e88aa5a Mon Sep 17 00:00:00 2001 From: jdlrobson Date: Fri, 13 Jul 2018 13:23:55 -0700 Subject: [PATCH] Match section issues to section number The section number relates to the position of the corresponding heading not the corresponding top level section. This only changes the URL, not the functionality. sub section issues will continue to be grouped along with other section issues. Bug: T197932 Change-Id: I325a3b477f89c9cc24f13ca017f478a6b7e7b68e --- resources/skins.minerva.scripts/cleanuptemplates.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/resources/skins.minerva.scripts/cleanuptemplates.js b/resources/skins.minerva.scripts/cleanuptemplates.js index 5cdb5c4..1c53c79 100644 --- a/resources/skins.minerva.scripts/cleanuptemplates.js +++ b/resources/skins.minerva.scripts/cleanuptemplates.js @@ -217,8 +217,12 @@ createBanner( $lead, label, 0, inline ); if ( isInGroupB ) { // parse other sections but only in group B. In treatment A no issues are shown for sections. - $lead.nextAll( '[class^="mf-section"]' ).each( function ( i, sectionEl ) { - createBanner( $( sectionEl ), label, i + 1, inline ); + $lead.nextAll( 'h1,h2,h3,h4,h5,h6' ).each( function ( i, headingEl ) { + var $headingEl = $( headingEl ), + $section = $headingEl.next(), + sectionNum = $headingEl.find( '.edit-page' ).data( 'section' ); + + createBanner( $section, label, sectionNum, inline ); } ); } }