mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-12-18 02:51:26 +00:00
Fix lede section button in Parsoid output
Change-Id: I3807984a3c57de7a41e06fb4b12cc4732343e39f
This commit is contained in:
parent
cd7b389bce
commit
74f2635026
|
@ -788,8 +788,11 @@ h1, h2, h3, h4, h5, h6 {
|
|||
// .mw-body-content selector prevents this applying to content in the preview (T318758)
|
||||
// On non-existent pages MobileFrontend wrapping isn't there
|
||||
.mw-body-content > .mw-talkpageheader,
|
||||
/* Legacy parser */
|
||||
.mw-body-content > .mf-section-0,
|
||||
.mw-body-content > .mw-parser-output > .mf-section-0 {
|
||||
.mw-body-content > .mw-parser-output > .mf-section-0,
|
||||
/* Parsoid */
|
||||
.mw-body-content > .mw-parser-output > section[ data-mw-section-id='0' ] {
|
||||
> *:not( .ext-discussiontools-emptystate ) {
|
||||
display: none;
|
||||
}
|
||||
|
|
|
@ -36,9 +36,10 @@ function init( $container ) {
|
|||
$( visualViewport ).on( 'resize', onViewportChangeThrottled );
|
||||
}
|
||||
|
||||
// Mobile overflow menu
|
||||
|
||||
const $ledeContent = $container.find( '.mf-section-0' ).children( ':not( .ext-discussiontools-emptystate )' )
|
||||
// Lede section button
|
||||
// mf-section-0: Legacy parser
|
||||
// data-mw-section-id: Parsoid
|
||||
const $ledeContent = $container.find( '.mf-section-0, [data-mw-section-id="0"]' ).children( ':not( .ext-discussiontools-emptystate )' )
|
||||
// On non-existent pages MobileFrontend wrapping isn't there
|
||||
.add( $container.find( '.mw-talkpageheader' ) );
|
||||
const $ledeButton = $container.find( '.ext-discussiontools-init-lede-button' );
|
||||
|
@ -50,7 +51,6 @@ function init( $container ) {
|
|||
windowManager.addWindows( [ ledeSectionDialog ] );
|
||||
}
|
||||
|
||||
// Lede section popup
|
||||
OO.ui.infuse( $ledeButton ).on( 'click', () => {
|
||||
mw.loader.using( 'oojs-ui-windows' ).then( () => {
|
||||
windowManager.openWindow( 'ledeSection', { $content: $ledeContent } );
|
||||
|
@ -60,6 +60,7 @@ function init( $container ) {
|
|||
mw.track( 'webuiactions_log.show', 'lede-button' );
|
||||
}
|
||||
|
||||
// New topic button
|
||||
// eslint-disable-next-line no-jquery/no-global-selector
|
||||
const $newTopicWrapper = $( '.ext-discussiontools-init-new-topic' );
|
||||
|
||||
|
|
Loading…
Reference in a new issue