Status-Widgets

status.activelist status.badge status.collapse status.log status.message status.notify status.toast


status.collapse

Show and hide a div or popup or collapse a section by a trigger item.

Parameters
{{ status.collapse(id, item_trigger, value, action) }}
id
unique id for this widget. Use this id in a div in the data-bind attribute to bind it to that widget (mandatory)
item_trigger
an item which triggers the collapse
value
the values on which the target will be collapsed (optional, default 0)
action
inverts the widget's behaviour, i.e. 'show' opens a popup instead of closing it if the trigger value is matched (optional, default = hide)
Examples
You may use this widget to hide or collapse some html or (new in v3.3) show / open it. To bind divs to the widget, use the "data-bind" attribute in the div - tag. In this example the div is bound to the status.collapse and will be controled by it. The additional class="hide" will hide the div at startup.
{{ status.collapse('w1', 'bath.alert.info', '0', 'hide') }}
<div class="hide" data-bind="w1">
...
</div>
Use it with simple html, to show and hide a div:

Every simple html-code could be collapsed ... with text and icons sample icon ...
Or use it to show and hide a popup:
<div id="status-popup" class="alert" data-bind="w2" data-role="popup" data-overlay-theme="a">
.... code for the popup
</div>

{{ status.collapse('w2', 'bath.alert.warning') }}

Popup

... or a popup ...

OK
Or use it to show and hide collapsible sections:
{{ status.collapse('w3', 'bath.alert.error') }}

<div class="block">
<div class="set-1" data-role="collapsible-set" data-theme="c" data-content-theme="a" data-mini="true">
<div data-bind="w3" data-role="collapsible" data-collapsed="false">
<h3>Block</h3>

<p>Content</p>
</div>

</div>
</div>

Block

Content

New in v3.1: a list of values can be used to make collapsing more flexible
Select a value to show the effects.
0 0 1 1 2 2 3 3 4 4

{{ status.collapse('w4', 'bath.multistate', [1, 2, 4]) }}
{{ status.collapse('w5', 'bath.multistate', [0, 3]) }}

<div class="hide" data-bind="w4">
{{ basic.symbol('', 'bath.multistate', '', ['secur_locked', 'audio_sound'], [0, 3]) }}
This section is collapsed if values match 1, 2 or 4
</div>
<div class="hide" data-bind="w5">
Now you've been choosing 1, 2 or 4.
{{ basic.symbol('', 'bath.multistate', '', ['audio_play', 'audio_pause', 'audio_stop'], [1, 2, 4]) }}
</div>
Result:
This section is collapsed if values match 1, 2 or 4
Now you've been choosing 1, 2 or 4.

Widgets

Design

Misc