Skip to content

Commit

Permalink
Merge branch 'MDL-74150' of https://github.com/lostrogit/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
junpataleta committed May 17, 2022
2 parents 5e5e12e + 3236a41 commit c238370
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Expand Up @@ -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.

Expand All @@ -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"
}
Expand All @@ -52,6 +54,7 @@ Disabled toggle with extra classes.
"name": "action",
"value": "toggle-status"
}],
"title": "Toggle Disabled",
"label": "Enable/disable status"
}
{{< /mustache >}}
Expand All @@ -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.

Expand Down
3 changes: 2 additions & 1 deletion lib/templates/toggle.mustache
Expand Up @@ -28,6 +28,7 @@
"name": "action",
"value": "toggle-reality"
}],
"title": "Title example",
"label": "Enable/disable reality",
"labelclasses": "sr-only"
}
Expand All @@ -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}}
Expand Down

0 comments on commit c238370

Please sign in to comment.