This commit is contained in:
Jun Pataleta 2022-05-17 11:54:57 +08:00
commit c238370ba7
2 changed files with 6 additions and 1 deletions

View File

@ -19,6 +19,7 @@ The parameters for the template context are:
* checked: If the initial status is checked.
* disabled: If toggle input is disabled.
* dataattributes: Array of name/value elements added as data-attributes.
* title: Title text.
* label: Label text.
* labelclasses: Any extra classes added to the label container.
@ -35,6 +36,7 @@ Checked toggle and with "sr-only" label.
"name": "action",
"value": "toggle-status"
}],
"title": "Toggle Enabled",
"label": "Enable/disable status",
"labelclasses": "sr-only"
}
@ -52,6 +54,7 @@ Disabled toggle with extra classes.
"name": "action",
"value": "toggle-status"
}],
"title": "Toggle Disabled",
"label": "Enable/disable status"
}
{{< /mustache >}}
@ -68,6 +71,7 @@ The parameters that you can define are:
* disabled
* labelmarkup: Label element code block.
* Should include *class="custom-control-label"*.
* title: Title text.
* label: Label text.
* labelclasses: Any extra classes added to the label container.

View File

@ -28,6 +28,7 @@
"name": "action",
"value": "toggle-reality"
}],
"title": "Title example",
"label": "Enable/disable reality",
"labelclasses": "sr-only"
}
@ -41,7 +42,7 @@
{{#disabled}}disabled{{/disabled}}
{{/attributes}}>
{{$labelmarkup}}
<label class="custom-control-label" for="{{$id}}{{id}}{{/id}}">
<label class="custom-control-label" for="{{$id}}{{id}}{{/id}}" {{#title}}data-toggle="tooltip" data-placement="top" title="{{title}}"{{/title}}>
<span class="{{$labelclasses}}{{labelclasses}}{{/labelclasses}}">{{$label}}{{label}}{{/label}}</span>
</label>
{{/labelmarkup}}