Skip to content

Commit 82f79b6

Browse files
monnardjlucaboesch
authored andcommitted
Update for bootstrap 5
1 parent 61c89eb commit 82f79b6

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

renderer.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -685,6 +685,7 @@ public function render_scheduler_slot_booker(scheduler_slot_booker $booker) {
685685
* @return string HTML
686686
*/
687687
public function render_action_menu(action_menu $menu) {
688+
global $CFG;
688689

689690
// We don't want the class icon there!
690691
foreach ($menu->get_secondary_actions() as $action) {
@@ -697,7 +698,9 @@ public function render_action_menu(action_menu $menu) {
697698
return '';
698699
}
699700
$context = $menu->export_for_template($this);
700-
701+
if ($CFG->version > 2025041400) {
702+
$context->primary->bs5 = "bs5";
703+
}
701704
return $this->render_from_template('mod_scheduler/action_menu', $context);
702705
}
703706

templates/action_menu_trigger.mustache

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
Example context (json):
2323
{
2424
"actiontext": "Example link text",
25+
"bs5": "bs5",
2526
"title": "Example link title",
2627
"triggerrole": "button",
2728
"triggerattributes": [
@@ -86,10 +87,10 @@
8687
<a
8788
href="#"
8889
tabindex="0"
89-
class="{{triggerextraclasses}} icon-no-margin"
90+
class="{{triggerextraclasses}} dropdown-toggle icon-no-margin"
9091
id="action-menu-toggle-{{instance}}"
9192
aria-label="{{title}}"
92-
data-bs-toggle="dropdown"
93+
data-{{#bs5}}bs-{{/bs5}}toggle="dropdown"
9394
role="{{triggerrole}}"
9495
aria-haspopup="true"
9596
aria-expanded="false"

0 commit comments

Comments
 (0)