Merge "Use ve.ui.AlignWidget in media dialog"

This commit is contained in:
jenkins-bot 2015-02-10 22:51:10 +00:00 committed by Gerrit Code Review
commit ae155b3616
2 changed files with 4 additions and 28 deletions

View file

@ -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',

View file

@ -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.$