Debian Codegraph @

extensions/DiscussionTools/modules/LedeSectionDialog.js

raw symbols SCIP
1 function LedeSectionDialog() {
2 // Parent constructor
3 LedeSectionDialog.super.apply( this, arguments );
4 }
5
6 /* Inheritance */
7 OO.inheritClass( LedeSectionDialog, OO.ui.ProcessDialog );
8
9 LedeSectionDialog.static.name = 'ledeSection';
10
11 LedeSectionDialog.static.size = 'larger';
12
13 LedeSectionDialog.static.title = OO.ui.deferMsg( 'discussiontools-ledesection-title' );
14
15 LedeSectionDialog.static.actions = [
16 {
17 label: OO.ui.deferMsg( 'visualeditor-dialog-action-done' ),
18 flags: [ 'safe', 'close' ]
19 }
20 ];
21
22 LedeSectionDialog.prototype.initialize = function () {
23 // Parent method
24 LedeSectionDialog.super.prototype.initialize.call( this );
25
26 this.contentLayout = new OO.ui.PanelLayout( {
27 padded: true,
28 expanded: false,
29 classes: [ 'ext-discussiontools-ui-ledeSectionDialog-content', 'mw-parser-output', 'content' ]
30 } );
31
32 this.$body.append( this.contentLayout.$element );
33 };
34
35 LedeSectionDialog.prototype.getSetupProcess = function ( data ) {
36 return LedeSectionDialog.super.prototype.getSetupProcess.call( this, data )
37 .next( () => {
38 this.contentLayout.$element.empty().append( data.$content );
39 // Resize dialog if collapsible banners are toggled, see T323639 for context
40 this.contentLayout.$element.on( 'afterExpand.mw-collapsible afterCollapse.mw-collapsible', () => {
41 this.updateSize();
42 } );
43 } );
44 };
45
46 module.exports = LedeSectionDialog;