Collapse constructor
Construct a collapse component and wire it to element
.
*
-
- If
toggle
is true, Toggles the collapsible element on invocation. Default: true.
- If
-
parent
determines if selector then all collapsible elements under the specified parent- will be closed when this collapsible item is shown.
- (similar to traditional accordion behavior -
- this dependent on the accordion-group class)
Implementation
Collapse(Element element, {bool? toggle, String? parent}) :
this._toggle = _data(toggle, element, 'toggle', true),
super(element, _name) {
if (parent == null)
parent = element.attributes["data-parent"];
if (parent != null)
_$parent = $(parent);
if (_toggle)
this.toggle();
}