jenkins-bot has submitted this change and it was merged.

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(-)

Approvals:
  Phuedx: Looks good to me, approved
  jenkins-bot: Verified



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: merged
Gerrit-Change-Id: I36a402ab43d75169112bdfd6090749c5b9dce7c6
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/QuickSurveys
Gerrit-Branch: dev
Gerrit-Owner: Jdlrobson <[email protected]>
Gerrit-Reviewer: Phuedx <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to