You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| target | Yes | <selectororthetarget> | This is required if group is not mentioned |
131
+
| target | Yes | <selectororthetarget> | This is required if group is not mentioned |
105
132
| attribute | No | <attributekey> | The attribute to toggle. Default: `toggled`|
106
133
| attribute-value | No | <attributevalue> | The attribute value when its. Default: `yes`|
107
-
|values| No | <commaseparatedvaluestomatch> | If this is specified, these comma separated values are matched with the value of the trigger. If they match, the target(s) is/are toggled. Same goes for having a `data-toggle-value` attribute on a target. |
134
+
|value| No | <commaseparatedvaluestomatch> | If this is specified, these comma separated values are matched with the value of the trigger. If they match, the target(s) is/are toggled. Same goes for having a `data-toggle-value` attribute on a target.|
108
135
| trigger | No | <selectorofthetrigger> | If this is not specified, the direct child is treated as the trigger. If it is mentioned, it looks for this selector within the context |
109
136
| closest-ancestor | No | <selectoroftheclosestancestor> | Default: `body`. If this is specified, the target is searched for within this selector, not on `body`. |
137
+
| non-empty-value | No | yes | A boolean attribute that signifies whether or not the targets should be toggled for all non empty values on the trigger.
// Toggle on element attribute if it matches value.
131
-
if(values.includes(value)){
147
+
// Initialize values.
148
+
letvalues: string[]=[];
149
+
150
+
// Null check.
151
+
if(valuesAttribute){
152
+
// Assign the values.
153
+
values=valuesAttribute.split(',');
154
+
}
155
+
156
+
// Toggle on element attribute if it matches value or it does not have a data-toggle-value attribute in which case it will match with all non empty values.
0 commit comments