Merge branch 'MDL-72642-master' of git://github.com/mihailges/moodle

This commit is contained in:
Andrew Nicols 2021-10-05 09:32:01 +08:00 committed by Eloy Lafuente (stronk7)
commit 598f3c2cc3
3 changed files with 10 additions and 8 deletions

View File

@ -64,6 +64,7 @@ class more_menu implements renderable, templatable {
} else {
$data['nodearray'] = (array) $this->content;
}
$data['moremenuid'] = uniqid();
return $data;
}

View File

@ -41,11 +41,12 @@
"action": "/admin/search.php"
}
]
}
},
"moremenuid": "614c104dbacfa"
}
}}
<nav class="moremenu">
<ul id="moremenu-{{ uniqid }}-{{navbarstyle}}" role="menubar" class="nav more-nav {{navbarstyle}}">
<ul id="moremenu-{{moremenuid}}-{{navbarstyle}}" role="menubar" class="nav more-nav {{navbarstyle}}">
{{#nodecollection}}
{{#children}}
{{> core/moremenu_children}}
@ -55,16 +56,16 @@
{{> core/moremenu_children}}
{{/nodearray}}
<li role="none" class="nav-item dropdown dropdownmoremenu d-none" data-region="morebutton">
<a class="dropdown-toggle nav-link" href="#" id="moremenu-dropdown{{ uniqid }}" role="menuitem" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" tabindex="-1">
<a class="dropdown-toggle nav-link" href="#" id="moremenu-dropdown-{{moremenuid}}" role="menuitem" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" tabindex="-1">
{{#str}}moremenu, core{{/str}}
</a>
<ul class="dropdown-menu dropdown-menu-right" data-region="moredropdown" aria-labelledby="moremenu-dropdown{{ uniqid }}" role="menu">
<ul class="dropdown-menu dropdown-menu-right" data-region="moredropdown" aria-labelledby="moremenu-dropdown-{{moremenuid}}" role="menu">
</ul>
</li>
</ul>
</nav>
{{#js}}
require(['core/moremenu'], function(moremenu) {
moremenu(document.querySelector('#moremenu-{{ uniqid }}-{{navbarstyle}}'));
moremenu(document.querySelector('#moremenu-{{moremenuid}}-{{navbarstyle}}'));
});
{{/js}}

View File

@ -23,7 +23,7 @@
{
"divider": "",
"haschildren": "",
"uniqid": "Unique string",
"moremenuid": "614c104dbacfa",
"text": "Moodle community",
"children": "",
"title": "Moodle community",
@ -32,10 +32,10 @@
}}
{{#haschildren}}
<li class="dropdown nav-item" role="none" data-forceintomoremenu="{{#forceintomoremenu}}true{{/forceintomoremenu}}{{^forceintomoremenu}}false{{/forceintomoremenu}}">
<a class="dropdown-toggle nav-link" id="drop-down-{{uniqid}}" role="menuitem" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" href="#" aria-controls="drop-down-menu-{{uniqid}}" tabindex="-1">
<a class="dropdown-toggle nav-link" id="drop-down-{{moremenuid}}" role="menuitem" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" href="#" aria-controls="drop-down-menu-{{moremenuid}}" tabindex="-1">
{{{text}}}
</a>
<div class="dropdown-menu" role="menu" id="drop-down-menu-{{uniqid}}" aria-labelledby="drop-down-{{uniqid}}">
<div class="dropdown-menu" role="menu" id="drop-down-menu-{{moremenuid}}" aria-labelledby="drop-down-{{moremenuid}}">
{{#children}}
{{^divider}}
<a class="dropdown-item" role="menuitem" href="{{{url}}}">{{{text}}}</a>