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
This commit is contained in:
Stephen Niedzielski 2018-08-14 09:45:54 -05:00 committed by Jdlrobson
parent 7eab78cb5e
commit ac245a7d97

View file

@ -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' );