From ac245a7d9722afb3f2e9102137002ac435c8d599 Mon Sep 17 00:00:00 2001 From: Stephen Niedzielski Date: Tue, 14 Aug 2018 09:45:54 -0500 Subject: [PATCH] Hygiene: don't hardcode page issue header selector When parsing page issues by header, use the MobileFrontend selector symbol, Page.HEADING_SELECTOR, instead of hardcoding it. This selector is configurable by the extension. Bug: T191528 Change-Id: I7c9db38f9102bfef0a98784be32c7e4707d747e5 --- resources/skins.minerva.scripts/cleanuptemplates.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/skins.minerva.scripts/cleanuptemplates.js b/resources/skins.minerva.scripts/cleanuptemplates.js index c05bce1..ed671be 100644 --- a/resources/skins.minerva.scripts/cleanuptemplates.js +++ b/resources/skins.minerva.scripts/cleanuptemplates.js @@ -1,5 +1,6 @@ ( function ( M, $ ) { var AB = M.require( 'skins.minerva.scripts/AB' ), + Page = M.require( 'mobile.startup/Page' ), allIssues = {}, KEYWORD_ALL_SECTIONS = 'all', config = mw.config, @@ -254,7 +255,7 @@ createBanner( $lead, label, 0, inline, overlayManager ); if ( newTreatmentEnabled ) { // parse other sections but only in group B. In treatment A no issues are shown for sections. - $lead.nextAll( 'h1,h2,h3,h4,h5,h6' ).each( function ( i, headingEl ) { + $lead.nextAll( Page.HEADING_SELECTOR ).each( function ( i, headingEl ) { var $headingEl = $( headingEl ), $section = $headingEl.next(), sectionNum = $headingEl.find( '.edit-page' ).data( 'section' );