mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-12-11 14:06:19 +00:00
Optional feature makes the transclusion dialog bigger
When $wgVisualEditorTransclusionDialogInlineDescriptions is set to true, the template dialog will use a larger format. Bug: T273971 Change-Id: Iad3c3f4d65125c83e35414ce15f793f6a1b192ef
This commit is contained in:
parent
a4d1863a80
commit
ded8c40915
|
@ -20,6 +20,12 @@ ve.ui.MWTransclusionDialog = function VeUiMWTransclusionDialog( config ) {
|
|||
|
||||
// Properties
|
||||
this.mode = null;
|
||||
|
||||
// Temporary override while feature flag is in place.
|
||||
this.isBigger = mw.config.get( 'wgVisualEditorConfig' ).transclusionDialogInlineDescriptions;
|
||||
if ( this.isBigger ) {
|
||||
this.$element.addClass( 've-ui-mwTransclusionDialog-bigger' );
|
||||
}
|
||||
};
|
||||
|
||||
/* Inheritance */
|
||||
|
@ -385,6 +391,27 @@ ve.ui.MWTransclusionDialog.prototype.getSetupProcess = function ( data ) {
|
|||
}, this );
|
||||
};
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*
|
||||
* Temporary override to increase dialog size when a feature flag is enabled.
|
||||
*/
|
||||
ve.ui.MWTransclusionDialog.prototype.getSizeProperties = function () {
|
||||
var size = this.getSize();
|
||||
|
||||
if ( this.isBigger ) {
|
||||
// Note that the base class makes an assumption that `width` is in raw
|
||||
// pixels, but no such assumption is made about the height.
|
||||
if ( size === 'medium' ) {
|
||||
return { width: 560, height: '90%' };
|
||||
} else if ( size === 'large' ) {
|
||||
return { width: 800, height: '90%' };
|
||||
}
|
||||
}
|
||||
|
||||
return ve.ui.MWTransclusionDialog.super.prototype.getSizeProperties.call( this );
|
||||
};
|
||||
|
||||
/* Registration */
|
||||
|
||||
ve.ui.windowFactory.register( ve.ui.MWTransclusionDialog );
|
||||
|
|
|
@ -69,3 +69,11 @@
|
|||
-moz-transition: all 250ms ease-in-out;
|
||||
transition: all 250ms ease-in-out;
|
||||
}
|
||||
|
||||
.ve-ui-mwTransclusionDialog-bigger .oo-ui-menuLayout > .oo-ui-menuLayout-menu {
|
||||
width: 240px;
|
||||
}
|
||||
|
||||
.ve-ui-mwTransclusionDialog-bigger .oo-ui-menuLayout > .oo-ui-menuLayout-content {
|
||||
left: 240px;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue