Fix MWReferenceGroupInputWidget and uses

Now it is an actual input widget, remove references
to .input property.

Bug: T150491
Change-Id: I826a2cb5ecf98d0e35ccab804f2aa90bbff7ada2
This commit is contained in:
Ed Sanders 2016-11-10 23:22:40 +00:00
parent c9c10d2998
commit 43f56c81a8
2 changed files with 5 additions and 5 deletions

View file

@ -152,7 +152,7 @@ ve.ui.MWReferenceDialog.prototype.documentHasContent = function () {
ve.ui.MWReferenceDialog.prototype.canApply = function () { ve.ui.MWReferenceDialog.prototype.canApply = function () {
return this.documentHasContent() && return this.documentHasContent() &&
( this.referenceTarget.getSurface().getModel().hasBeenModified() || ( this.referenceTarget.getSurface().getModel().hasBeenModified() ||
this.referenceGroupInput.input.getValue() !== this.originalGroup ); this.referenceGroupInput.getValue() !== this.originalGroup );
}; };
/** /**
@ -270,7 +270,7 @@ ve.ui.MWReferenceDialog.prototype.useReference = function ( ref ) {
this.originalGroup = this.referenceModel.getGroup(); this.originalGroup = this.referenceModel.getGroup();
// Set the group input while it's disabled, so this doesn't pop up the group-picker menu // Set the group input while it's disabled, so this doesn't pop up the group-picker menu
this.referenceGroupInput.setDisabled( true ); this.referenceGroupInput.setDisabled( true );
this.referenceGroupInput.input.setValue( this.originalGroup ); this.referenceGroupInput.setValue( this.originalGroup );
this.referenceGroupInput.setDisabled( false ); this.referenceGroupInput.setDisabled( false );
this.contentFieldset.$element.append( this.referenceTarget.$element ); this.contentFieldset.$element.append( this.referenceTarget.$element );
this.referenceTarget.initialize(); this.referenceTarget.initialize();
@ -317,7 +317,7 @@ ve.ui.MWReferenceDialog.prototype.initialize = function () {
$overlay: this.$overlay, $overlay: this.$overlay,
emptyGroupName: ve.msg( 'cite-ve-dialog-reference-options-group-placeholder' ) emptyGroupName: ve.msg( 'cite-ve-dialog-reference-options-group-placeholder' )
} ); } );
this.referenceGroupInput.input.connect( this, { change: 'onReferenceGroupInputChange' } ); this.referenceGroupInput.connect( this, { change: 'onReferenceGroupInputChange' } );
this.referenceGroupField = new OO.ui.FieldLayout( this.referenceGroupInput, { this.referenceGroupField = new OO.ui.FieldLayout( this.referenceGroupInput, {
align: 'top', align: 'top',
label: ve.msg( 'cite-ve-dialog-reference-options-group-label' ) label: ve.msg( 'cite-ve-dialog-reference-options-group-label' )
@ -358,7 +358,7 @@ ve.ui.MWReferenceDialog.prototype.getActionProcess = function ( action ) {
return new OO.ui.Process( function () { return new OO.ui.Process( function () {
var surfaceModel = this.getFragment().getSurface(); var surfaceModel = this.getFragment().getSurface();
this.referenceModel.setGroup( this.referenceGroupInput.input.getValue() ); this.referenceModel.setGroup( this.referenceGroupInput.getValue() );
// Insert reference (will auto-create an internal item if needed) // Insert reference (will auto-create an internal item if needed)
if ( !( this.selectedNode instanceof ve.dm.MWReferenceNode ) ) { if ( !( this.selectedNode instanceof ve.dm.MWReferenceNode ) ) {

View file

@ -21,7 +21,7 @@ ve.ui.MWReferenceGroupInputWidget = function VeUiMWReferenceGroupInputWidget( co
this.emptyGroupName = config.emptyGroupName; this.emptyGroupName = config.emptyGroupName;
// Parent constructor // Parent constructor
ve.ui.MWReferenceGroupInputWidget.super.call( this, $.extend( true, { input: { placeholder: config.emptyGroupName } }, config ) ); ve.ui.MWReferenceGroupInputWidget.super.call( this, ve.extendObject( { placeholder: config.emptyGroupName }, config ) );
this.$element.addClass( 've-ui-mwReferenceGroupInputWidget' ); this.$element.addClass( 've-ui-mwReferenceGroupInputWidget' );
}; };