diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2015-12-17 09:15:42 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2015-12-17 09:44:51 +0100 |
commit | a1789ddde42033f1b05cc4929491214ee6e79383 (patch) | |
tree | 63615735c4ddffaaabf2428946bb26f90899f7bf /vendor/oojs/oojs-ui/php/widgets/DropdownInputWidget.php | |
parent | 9e06a62f265e3a2aaabecc598d4bc617e06fa32d (diff) |
Update to MediaWiki 1.26.0
Diffstat (limited to 'vendor/oojs/oojs-ui/php/widgets/DropdownInputWidget.php')
-rw-r--r-- | vendor/oojs/oojs-ui/php/widgets/DropdownInputWidget.php | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/vendor/oojs/oojs-ui/php/widgets/DropdownInputWidget.php b/vendor/oojs/oojs-ui/php/widgets/DropdownInputWidget.php index ae541a66..f8ea48a3 100644 --- a/vendor/oojs/oojs-ui/php/widgets/DropdownInputWidget.php +++ b/vendor/oojs/oojs-ui/php/widgets/DropdownInputWidget.php @@ -23,6 +23,10 @@ class DropdownInputWidget extends InputWidget { // Parent constructor parent::__construct( $config ); + // Mixins + $this->mixin( new TitledElement( $this, + array_merge( $config, array( 'titled' => $this->input ) ) ) ); + // Initialization $this->setOptions( isset( $config['options'] ) ? $config['options'] : array() ); $this->addClasses( array( 'oo-ui-dropdownInputWidget' ) ); @@ -60,11 +64,12 @@ class DropdownInputWidget extends InputWidget { // Rebuild the dropdown menu $this->input->clearContent(); foreach ( $options as $opt ) { + $optValue = $this->cleanUpValue( $opt['data'] ); $option = new Tag( 'option' ); - $option->setAttributes( array( 'value' => $opt['data'] ) ); - $option->appendContent( isset( $opt['label'] ) ? $opt['label'] : $opt['data'] ); + $option->setAttributes( array( 'value' => $optValue ) ); + $option->appendContent( isset( $opt['label'] ) ? $opt['label'] : $optValue ); - if ( $value === $opt['data'] ) { + if ( $value === $optValue ) { $isValueAvailable = true; } |