Visually, this only affects OOUIHTMLForm, in other kinds of forms
the element has no height anyway.
Change-Id: I90e73c49fbefec23532368848bb30b2e7b69075c
- $html = Html::rawElement( 'span',
- [ 'class' => 'mw-htmlform-submit-buttons' ], "\n$buttons" ) . "\n";
+ if ( !$buttons ) {
+ return '';
+ }
+ return Html::rawElement( 'span',
+ [ 'class' => 'mw-htmlform-submit-buttons' ], "\n$buttons" ) . "\n";
- $html = Html::rawElement( 'div',
- [ 'class' => 'mw-htmlform-submit-buttons' ], "\n$buttons" ) . "\n";
+ if ( !$buttons ) {
+ return '';
+ }
+ return Html::rawElement( 'div',
+ [ 'class' => 'mw-htmlform-submit-buttons' ], "\n$buttons" ) . "\n";
}
protected function wrapFieldSetSection( $legend, $section, $attributes ) {
}
protected function wrapFieldSetSection( $legend, $section, $attributes ) {
$buttons .= Html::element( 'input', $attrs ) . "\n";
}
$buttons .= Html::element( 'input', $attrs ) . "\n";
}
- $html = Html::rawElement( 'div',
- [ 'class' => 'mw-htmlform-submit-buttons' ], "\n$buttons" ) . "\n";
+ if ( !$buttons ) {
+ return '';
+ }
+ return Html::rawElement( 'div',
+ [ 'class' => 'mw-htmlform-submit-buttons' ], "\n$buttons" ) . "\n";