NEW Add hideNav flag to schema defaults

This commit is contained in:
Raissa North 2018-09-18 09:52:46 +12:00
parent a33866ff4c
commit 588bf83e12

View File

@ -243,4 +243,19 @@ class TabSet extends CompositeField
}
return parent::insertAfter($insertAfter, $field);
}
/**
* Sets an additional default for $schemaData.
* The existing keys are immutable. HideNav is added in this overriding method to ensure it is not ignored by
* {@link setSchemaData()}
* It allows hiding of the navigation in the Tabs.js React component.
*
* @return array
*/
public function getSchemaStateDefaults()
{
$defaults = parent::getSchemaStateDefaults();
$defaults['hideNav'] = false;
return $defaults;
}
}