mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 10:35:48 +00:00
Merge "Use ve.ui.AlignWidget in media dialog"
This commit is contained in:
commit
ae155b3616
|
@ -569,6 +569,7 @@ $wgResourceModules += array(
|
||||||
|
|
||||||
'lib/ve/src/ui/windowmanagers/ve.ui.ToolbarDialogWindowManager.js',
|
'lib/ve/src/ui/windowmanagers/ve.ui.ToolbarDialogWindowManager.js',
|
||||||
|
|
||||||
|
'lib/ve/src/ui/widgets/ve.ui.AlignWidget.js',
|
||||||
'lib/ve/src/ui/widgets/ve.ui.SurfaceWidget.js',
|
'lib/ve/src/ui/widgets/ve.ui.SurfaceWidget.js',
|
||||||
'lib/ve/src/ui/widgets/ve.ui.LinkTargetInputWidget.js',
|
'lib/ve/src/ui/widgets/ve.ui.LinkTargetInputWidget.js',
|
||||||
'lib/ve/src/ui/widgets/ve.ui.ContextSelectWidget.js',
|
'lib/ve/src/ui/widgets/ve.ui.ContextSelectWidget.js',
|
||||||
|
|
|
@ -155,8 +155,7 @@ ve.ui.MWMediaDialog.prototype.getBodyHeight = function () {
|
||||||
* @inheritdoc
|
* @inheritdoc
|
||||||
*/
|
*/
|
||||||
ve.ui.MWMediaDialog.prototype.initialize = function () {
|
ve.ui.MWMediaDialog.prototype.initialize = function () {
|
||||||
var altTextFieldset, positionFieldset, borderField, positionField,
|
var altTextFieldset, positionFieldset, borderField, positionField;
|
||||||
alignLeftButton, alignCenterButton, alignRightButton, alignButtons;
|
|
||||||
|
|
||||||
// Parent method
|
// Parent method
|
||||||
ve.ui.MWMediaDialog.super.prototype.initialize.call( this );
|
ve.ui.MWMediaDialog.super.prototype.initialize.call( this );
|
||||||
|
@ -242,34 +241,10 @@ ve.ui.MWMediaDialog.prototype.initialize = function () {
|
||||||
.append( this.altTextInput.$element );
|
.append( this.altTextInput.$element );
|
||||||
|
|
||||||
// Position
|
// Position
|
||||||
this.positionSelect = new OO.ui.ButtonSelectWidget( {
|
this.positionSelect = new ve.ui.AlignWidget( {
|
||||||
$: this.$
|
|
||||||
} );
|
|
||||||
|
|
||||||
alignLeftButton = new OO.ui.ButtonOptionWidget( {
|
|
||||||
$: this.$,
|
$: this.$,
|
||||||
data: 'left',
|
dir: this.getDir()
|
||||||
icon: 'align-float-left',
|
|
||||||
label: ve.msg( 'visualeditor-dialog-media-position-left' )
|
|
||||||
} );
|
} );
|
||||||
alignCenterButton = new OO.ui.ButtonOptionWidget( {
|
|
||||||
$: this.$,
|
|
||||||
data: 'center',
|
|
||||||
icon: 'align-center',
|
|
||||||
label: ve.msg( 'visualeditor-dialog-media-position-center' )
|
|
||||||
} );
|
|
||||||
alignRightButton = new OO.ui.ButtonOptionWidget( {
|
|
||||||
$: this.$,
|
|
||||||
data: 'right',
|
|
||||||
icon: 'align-float-right',
|
|
||||||
label: ve.msg( 'visualeditor-dialog-media-position-right' )
|
|
||||||
} );
|
|
||||||
|
|
||||||
alignButtons = ( this.getDir() === 'ltr' ) ?
|
|
||||||
[ alignLeftButton, alignCenterButton, alignRightButton ] :
|
|
||||||
[ alignRightButton, alignCenterButton, alignLeftButton ];
|
|
||||||
|
|
||||||
this.positionSelect.addItems( alignButtons, 0 );
|
|
||||||
|
|
||||||
this.positionCheckbox = new OO.ui.CheckboxInputWidget( {
|
this.positionCheckbox = new OO.ui.CheckboxInputWidget( {
|
||||||
$: this.$
|
$: this.$
|
||||||
|
|
Loading…
Reference in a new issue