Also minor tweaks:
* Fix @since tags, this did not make it into 1.33
* Fix usage of FieldsetLayout 'group' in OOUIHTMLForm
* Documentation changes
Follow-up to
2896e87a1007202f5416fe506c691652b27c4ac9,
per my post-merge review on that commit.
Change-Id: Ib93375cde19730a46e4929878d6e472d3ac8f631
$htmlForm
->setMethod( 'get' )
->setAction( wfScript() )
$htmlForm
->setMethod( 'get' )
->setAction( wfScript() )
- ->setCollapsible( true )
+ ->setCollapsibleOptions( true )
->setId( 'mw-history-searchform' )
->setSubmitText( $this->msg( 'historyaction-submit' )->text() )
->setWrapperAttributes( [ 'id' => 'mw-history-search' ] )
->setId( 'mw-history-searchform' )
->setSubmitText( $this->msg( 'historyaction-submit' )->text() )
->setWrapperAttributes( [ 'id' => 'mw-history-search' ] )
protected $mAction = false;
/**
protected $mAction = false;
/**
- * Whether the HTML form can be collapsed
- * @since 1.33
+ * Whether the form can be collapsed
+ * @since 1.34
* @var bool
*/
protected $mCollapsible = false;
/**
* @var bool
*/
protected $mCollapsible = false;
/**
- * Whether the HTML form IS collapsed by default
- * @since 1.33
+ * Whether the form is collapsed by default
+ * @since 1.34
* @var bool
*/
protected $mCollapsed = false;
* @var bool
*/
protected $mCollapsed = false;
- * Make the form collapsible
- * @since 1.33
- * @param bool $collapsed whether it should be by default
- * @return HTMLForm $this for chaining calls (since 1.20)
+ * Set whether the HTML form can be collapsed.
+ *
+ * @since 1.34
+ * @param bool $collapsedByDefault (optional) whether the form is collapsed by default
+ * @return HTMLForm $this for chaining calls
- public function setCollapsible( $collapsed = false ) {
+ public function setCollapsibleOptions( $collapsedByDefault = false ) {
$this->mCollapsible = true;
$this->mCollapsible = true;
- $this->mCollapsed = $collapsed;
+ $this->mCollapsed = $collapsedByDefault;
'classes' => $classes,
'group' => new OOUI\StackLayout( [
'expanded' => false,
'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 )
- ] ),
- ],
+ 'classes' => [ 'mw-collapsible-content' ],
+ 'items' => [
+ new OOUI\Widget( [
+ 'content' => new OOUI\HtmlSnippet( $html )
+ ] ),
+ ],
] + OOUI\Element::configFromHtmlAttributes( $this->mWrapperAttributes ) );
} else {
$content = new OOUI\HtmlSnippet( $html );
] + OOUI\Element::configFromHtmlAttributes( $this->mWrapperAttributes ) );
} else {
$content = new OOUI\HtmlSnippet( $html );