1 Demo.DynamicLabelTextInputWidget = function DemoDynamicLabelTextInputWidget( config ) {
2 // Configuration initialization
3 config = $.extend( { getLabelText: $.noop }, config );
5 Demo.DynamicLabelTextInputWidget.parent.call( this, config );
7 this.getLabelText = config.getLabelText;
9 this.connect( this, { change: 'onChange' } );
11 this.setLabel( this.getLabelText( this.getValue() ) );
13 OO.inheritClass( Demo.DynamicLabelTextInputWidget, OO.ui.TextInputWidget );
15 Demo.DynamicLabelTextInputWidget.prototype.onChange = function ( value ) {
16 this.setLabel( this.getLabelText( value ) );