diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:32:59 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:32:59 -0400 |
commit | 6dc1997577fab2c366781fd7048144935afa0012 (patch) | |
tree | 8918d28c7ab4342f0738985e37af1dfc42d0e93a /vendor/oojs/oojs-ui/php/widgets/ButtonInputWidget.php | |
parent | 150f94f051128f367bc89f6b7e5f57eb2a69fc62 (diff) | |
parent | fa89acd685cb09cdbe1c64cbb721ec64975bbbc1 (diff) |
Merge commit 'fa89acd'
# Conflicts:
# .gitignore
# extensions/ArchInterWiki.sql
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; } |