Adapt the type input to work with the new ooui getMenu()

The type in the templatedata editor didn't update because the events
were attached to the previous ooui SelectWidget, and should be
adjusted to use the new methods.

Bug: T86922
Change-Id: I619d1cc69f672d2d03d7dafa97ba3d950de9d89d
This commit is contained in:
Moriel Schottlender 2015-01-18 11:20:11 -08:00 committed by Jforrester
parent b4fb04a142
commit edf70972e1

View file

@ -327,7 +327,7 @@
allProps = TemplateDataModel.static.getAllProperties( true );
if ( property === 'type' ) {
value = this.propInputs[property].getSelectedItem() ? this.propInputs[property].getSelectedItem().getData() : 'undefined';
value = this.propInputs[property].getMenu().getSelectedItem() ? this.propInputs[property].getMenu().getSelectedItem().getData() : 'undefined';
}
// TODO: Validate the name
@ -538,7 +538,7 @@
} );
// Event
if ( props === 'type' ) {
propInput.connect( this, { choose: [ 'onParamPropertyInputChange', props ] } );
propInput.getMenu().connect( this, { choose: [ 'onParamPropertyInputChange', props ] } );
} else {
propInput.connect( this, { change: [ 'onParamPropertyInputChange', props ] } );
}