[ 'class' => 'mw-htmlform-submit-buttons' ], "\n$buttons" ) . "\n";
}
+ /**
+ * @inheritDoc
+ * @return OOUI\PanelLayout
+ */
protected function wrapFieldSetSection( $legend, $section, $attributes, $isRoot ) {
// to get a user visible effect, wrap the fieldset into a framed panel layout
$layout = new OOUI\PanelLayout( [
public function wrapForm( $html ) {
if ( is_string( $this->mWrapperLegend ) ) {
+ $classes = $this->mCollapsible ? [ 'mw-collapsible' ] : [];
+ if ( $this->mCollapsed ) {
+ $classes[] = 'mw-collapsed';
+ }
$content = new OOUI\FieldsetLayout( [
'label' => $this->mWrapperLegend,
- 'items' => [
- new OOUI\Widget( [
- 'content' => new OOUI\HtmlSnippet( $html )
- ] ),
- ],
- ] );
+ 'classes' => $classes,
+ 'group' => new OOUI\StackLayout( [
+ 'expanded' => false,
+ 'classes' => [ 'oo-ui-fieldsetLayout-group mw-collapsible-content' ],
+ 'items' => [
+ new OOUI\Widget( [
+ 'content' => new OOUI\HtmlSnippet( $html )
+ ] ),
+ ],
+ ] ),
+ ] + OOUI\Element::configFromHtmlAttributes( $this->mWrapperAttributes ) );
} else {
$content = new OOUI\HtmlSnippet( $html );
}
+ $classes = [ 'mw-htmlform', 'mw-htmlform-ooui' ];
$form = new OOUI\FormLayout( $this->getFormAttributes() + [
- 'classes' => [ 'mw-htmlform', 'mw-htmlform-ooui' ],
+ 'classes' => $classes,
'content' => $content,
] );