2022-09-27 14:48:25 +00:00
|
|
|
function LedeSectionDialog() {
|
|
|
|
// Parent constructor
|
|
|
|
LedeSectionDialog.super.apply( this, arguments );
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Inheritance */
|
|
|
|
OO.inheritClass( LedeSectionDialog, OO.ui.ProcessDialog );
|
|
|
|
|
|
|
|
LedeSectionDialog.static.name = 'ledeSection';
|
|
|
|
|
|
|
|
LedeSectionDialog.static.size = 'larger';
|
|
|
|
|
|
|
|
LedeSectionDialog.static.title = OO.ui.deferMsg( 'discussiontools-ledesection-title' );
|
|
|
|
|
|
|
|
LedeSectionDialog.static.actions = [
|
|
|
|
{
|
|
|
|
label: OO.ui.deferMsg( 'visualeditor-dialog-action-done' ),
|
|
|
|
flags: [ 'safe', 'close' ]
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
|
|
|
LedeSectionDialog.prototype.initialize = function () {
|
|
|
|
// Parent method
|
|
|
|
LedeSectionDialog.super.prototype.initialize.call( this );
|
|
|
|
|
|
|
|
this.contentLayout = new OO.ui.PanelLayout( {
|
|
|
|
padded: true,
|
|
|
|
expanded: false,
|
|
|
|
classes: [ 'ext-discussiontools-ui-ledeSectionDialog-content', 'mw-parser-output', 'content' ]
|
|
|
|
} );
|
|
|
|
|
|
|
|
this.$body.append( this.contentLayout.$element );
|
|
|
|
};
|
|
|
|
|
|
|
|
LedeSectionDialog.prototype.getSetupProcess = function ( data ) {
|
|
|
|
return LedeSectionDialog.super.prototype.getSetupProcess.call( this, data )
|
2024-04-18 18:37:58 +00:00
|
|
|
.next( () => {
|
2022-09-27 14:48:25 +00:00
|
|
|
this.contentLayout.$element.empty().append( data.$content );
|
2024-06-03 22:54:35 +00:00
|
|
|
// Resize dialog if collapsible banners are toggled, see T323639 for context
|
|
|
|
this.contentLayout.$element.on( 'afterExpand.mw-collapsible afterCollapse.mw-collapsible', () => {
|
|
|
|
this.updateSize();
|
|
|
|
} );
|
2024-04-18 18:37:58 +00:00
|
|
|
} );
|
2022-09-27 14:48:25 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = LedeSectionDialog;
|