Jdlrobson has uploaded a new change for review.
https://gerrit.wikimedia.org/r/234420
Change subject: Don't inject survey into table of contents
......................................................................
Don't inject survey into table of contents
Rely on headings that are child elements of content
Use mw-content-ltr or rtl for insertion rather than bodyContent
due to inconsistency between mobile and desktop skin.
On mobile skin #bodyContent has this class
On desktop skin #mw-content-text has it
Bug: T110244
Change-Id: I36a402ab43d75169112bdfd6090749c5b9dce7c6
---
M resources/ext.quicksurveys.init/init.js
1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/QuickSurveys
refs/changes/20/234420/1
diff --git a/resources/ext.quicksurveys.init/init.js
b/resources/ext.quicksurveys.init/init.js
index b0b6269..313ce45 100644
--- a/resources/ext.quicksurveys.init/init.js
+++ b/resources/ext.quicksurveys.init/init.js
@@ -24,8 +24,8 @@
}
if ( inSample || mw.util.getParamValue( 'quicksurvey' )
) {
- $bodyContent = $( '#bodyContent' );
- $place = $bodyContent.find( 'h1, h2, h3, h4,
h5, h6' ).eq( 0 );
+ $bodyContent = $( '.mw-content-ltr,
.mw-content-rtl' );
+ $place = $bodyContent.find( '> h1, > h2, > h3,
> h4, > h5, > h6' ).eq( 0 );
if ( $place.length ) {
$panel.insertBefore( $place );
--
To view, visit https://gerrit.wikimedia.org/r/234420
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I36a402ab43d75169112bdfd6090749c5b9dce7c6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/QuickSurveys
Gerrit-Branch: dev
Gerrit-Owner: Jdlrobson <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits