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:
parent
7eab78cb5e
commit
ac245a7d97
|
@ -1,5 +1,6 @@
|
||||||
( function ( M, $ ) {
|
( function ( M, $ ) {
|
||||||
var AB = M.require( 'skins.minerva.scripts/AB' ),
|
var AB = M.require( 'skins.minerva.scripts/AB' ),
|
||||||
|
Page = M.require( 'mobile.startup/Page' ),
|
||||||
allIssues = {},
|
allIssues = {},
|
||||||
KEYWORD_ALL_SECTIONS = 'all',
|
KEYWORD_ALL_SECTIONS = 'all',
|
||||||
config = mw.config,
|
config = mw.config,
|
||||||
|
@ -254,7 +255,7 @@
|
||||||
createBanner( $lead, label, 0, inline, overlayManager );
|
createBanner( $lead, label, 0, inline, overlayManager );
|
||||||
if ( newTreatmentEnabled ) {
|
if ( newTreatmentEnabled ) {
|
||||||
// parse other sections but only in group B. In treatment A no issues are shown for sections.
|
// 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 ),
|
var $headingEl = $( headingEl ),
|
||||||
$section = $headingEl.next(),
|
$section = $headingEl.next(),
|
||||||
sectionNum = $headingEl.find( '.edit-page' ).data( 'section' );
|
sectionNum = $headingEl.find( '.edit-page' ).data( 'section' );
|
||||||
|
|
Loading…
Reference in New Issue