X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=blobdiff_plain;f=includes%2Fhtmlform%2FOOUIHTMLForm.php;h=baafa5e7215467f152ef650b64b8b3a8ada12926;hb=a5230acd936b5b9270037c35b9d2d419f4c8d9a6;hp=e21d783fcc3685ad2dd267e33aed2e32fb4cab96;hpb=7bd9073c4b9d14a31a8a3b539fcbb9b3877d824d;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/htmlform/OOUIHTMLForm.php b/includes/htmlform/OOUIHTMLForm.php index e21d783fcc..baafa5e721 100644 --- a/includes/htmlform/OOUIHTMLForm.php +++ b/includes/htmlform/OOUIHTMLForm.php @@ -281,8 +281,17 @@ class OOUIHTMLForm extends HTMLForm { 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, + 'classes' => $classes, + 'group' => new OOUI\StackLayout( [ + 'expanded' => false, + 'classes' => [ 'mw-collapsible-content' ], + ] ), 'items' => [ new OOUI\Widget( [ 'content' => new OOUI\HtmlSnippet( $html ) @@ -293,8 +302,9 @@ class OOUIHTMLForm extends HTMLForm { $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, ] );