MDL-62145 theme_boost: Custom menu fixes

Make sure the site navigation element is labelled, actionmenu items
have correct role and actionmenu trigger controls the menu.
This commit is contained in:
Damyon Wiese 2018-09-05 13:14:31 +08:00
parent 40a90154ca
commit 9d0c5cbbc4
3 changed files with 5 additions and 4 deletions

View file

@ -1050,6 +1050,7 @@ $string['showdetails'] = 'Show details';
$string['showuseridentity'] = 'Show user identity'; $string['showuseridentity'] = 'Show user identity';
$string['showuseridentity_desc'] = 'When selecting or searching for users, and when displaying lists of users, these fields may be shown in addition to their full name. The fields are only shown to users who have the moodle/site:viewuseridentity capability; by default, teachers and managers. (This option makes most sense if you choose one or two fields that are mandatory at your institution.)'; $string['showuseridentity_desc'] = 'When selecting or searching for users, and when displaying lists of users, these fields may be shown in addition to their full name. The fields are only shown to users who have the moodle/site:viewuseridentity capability; by default, teachers and managers. (This option makes most sense if you choose one or two fields that are mandatory at your institution.)';
$string['simplexmlrequired'] = 'The SimpleXML PHP extension is now required by Moodle.'; $string['simplexmlrequired'] = 'The SimpleXML PHP extension is now required by Moodle.';
$string['sitemenubar'] = 'Site navigation';
$string['sitemailcharset'] = 'Character set'; $string['sitemailcharset'] = 'Character set';
$string['sitemaintenance'] = 'The site is undergoing maintenance and is currently not available'; $string['sitemaintenance'] = 'The site is undergoing maintenance and is currently not available';
$string['sitemaintenancemode'] = 'Maintenance mode'; $string['sitemaintenancemode'] = 'Maintenance mode';

View file

@ -1,13 +1,13 @@
{{^divider}} {{^divider}}
{{#haschildren}} {{#haschildren}}
<li class="dropdown nav-item"> <li class="dropdown nav-item">
<a class="dropdown-toggle nav-link" id="drop-down-{{uniqid}}" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" href="#"> <a class="dropdown-toggle nav-link" id="drop-down-{{uniqid}}" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" href="#" aria-controls="drop-down-menu-{{uniqid}}">
{{{text}}} {{{text}}}
</a> </a>
<div class="dropdown-menu" aria-labelledby="drop-down-{{uniqid}}"> <div class="dropdown-menu" role="menu" id="drop-down-menu-{{uniqid}}" aria-labelledby="drop-down-{{uniqid}}">
{{#children}} {{#children}}
{{^divider}} {{^divider}}
<a class="dropdown-item" href="{{{url}}}" {{#title}}title="{{{title}}}"{{/title}}>{{{text}}}</a> <a class="dropdown-item" role="menuitem" href="{{{url}}}" {{#title}}title="{{{title}}}"{{/title}}>{{{text}}}</a>
{{/divider}} {{/divider}}
{{#divider}} {{#divider}}
<div class="dropdown-divider" role="presentation"></div> <div class="dropdown-divider" role="presentation"></div>

View file

@ -17,7 +17,7 @@
{{! {{!
Page navbar. Page navbar.
}} }}
<nav class="fixed-top navbar navbar-light bg-white navbar-expand moodle-has-zindex"> <nav class="fixed-top navbar navbar-light bg-white navbar-expand moodle-has-zindex" aria-label="{{#str}}sitemenubar, admin{{/str}}">
<div data-region="drawer-toggle" class="d-inline-block mr-3"> <div data-region="drawer-toggle" class="d-inline-block mr-3">
<button aria-expanded="{{#navdraweropen}}true{{/navdraweropen}}{{^navdraweropen}}false{{/navdraweropen}}" aria-controls="nav-drawer" type="button" class="btn nav-link float-sm-left mr-1 btn-secondary" data-action="toggle-drawer" data-side="left" data-preference="drawer-open-nav">{{#pix}}i/menubars{{/pix}}<span class="sr-only">{{#str}}sidepanel, core{{/str}}</span></button> <button aria-expanded="{{#navdraweropen}}true{{/navdraweropen}}{{^navdraweropen}}false{{/navdraweropen}}" aria-controls="nav-drawer" type="button" class="btn nav-link float-sm-left mr-1 btn-secondary" data-action="toggle-drawer" data-side="left" data-preference="drawer-open-nav">{{#pix}}i/menubars{{/pix}}<span class="sr-only">{{#str}}sidepanel, core{{/str}}</span></button>