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/ButtonInputWidget.php | |
parent | 9e06a62f265e3a2aaabecc598d4bc617e06fa32d (diff) |
Update to MediaWiki 1.26.0
Diffstat (limited to 'vendor/oojs/oojs-ui/php/widgets/ButtonInputWidget.php')
-rw-r--r-- | vendor/oojs/oojs-ui/php/widgets/ButtonInputWidget.php | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/vendor/oojs/oojs-ui/php/widgets/ButtonInputWidget.php b/vendor/oojs/oojs-ui/php/widgets/ButtonInputWidget.php index b3bcb63b..00c17912 100644 --- a/vendor/oojs/oojs-ui/php/widgets/ButtonInputWidget.php +++ b/vendor/oojs/oojs-ui/php/widgets/ButtonInputWidget.php @@ -6,6 +6,15 @@ namespace OOUI; * A button that is an input widget. Intended to be used within a FormLayout. */ class ButtonInputWidget extends InputWidget { + + /* Static Properties */ + + /** + * Disable generating `<label>` elements for buttons. One would very rarely need additional label + * for a button, and it's already a big clickable target, and it causes unexpected rendering. + */ + public static $supportsSimpleLabel = false; + /* Properties */ /** @@ -60,8 +69,11 @@ class ButtonInputWidget extends InputWidget { } protected function getInputElement( $config ) { + $type = in_array( $config['type'], array( 'button', 'submit', 'reset' ) ) ? + $config['type'] : + 'button'; $input = new Tag( $config['useInputTag'] ? 'input' : 'button' ); - $input->setAttributes( array( 'type' => $config['type'] ) ); + $input->setAttributes( array( 'type' => $type ) ); return $input; } |