Skip to content

Commit

Permalink
Nav-Drawer Button Position
Browse files Browse the repository at this point in the history
Feature: michael-milette#19
-Changed the position of Nav-Drawer button
-Added a new Chevron icon/button to close Nav-Drawer
-Nav-Drawer can be closed using any of the two icons/buttons
  • Loading branch information
sameer-ah committed Sep 23, 2021
1 parent 2f30c46 commit 4f6396e
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 6 deletions.
1 change: 1 addition & 0 deletions classes/output/core_renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ public function full_header() {
$header->searchurl = $_PAGE['searchurl'];
$header->searchsettings = $_PAGE['searchsettings'];
$header->sitename = $_PAGE['sitename'];
$header->shownavdrawer = $_PAGE['shownavdrawer'];
$header->navdraweropen = $_PAGE['navdraweropen'];
$header->showaccountsettings = $_PAGE['showaccountsettings'];
$header->loggedin = $_PAGE['loggedin'];
Expand Down
10 changes: 10 additions & 0 deletions style/wet-boew-moodle.css
Original file line number Diff line number Diff line change
Expand Up @@ -1643,3 +1643,13 @@ body.path-mod-feedback div.feedback-item-label span.d-inline-block {
height: 2.7rem;
font-size: 1.4rem
}

.nav-drawer-chevron-button{
top:0;
left:250px;
position: absolute;
}

.nav-drawer-chevron-button:hover{
cursor: pointer;
}
2 changes: 1 addition & 1 deletion templates/footer.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,6 @@

<div id="level-access-access-assistant-highlight-container" data-ae_invis="true"></div>
{{#shownavdrawer}}
{{> theme_boost/nav-drawer }}
{{> theme_gcweb/nav-drawer }}
{{/shownavdrawer}}
{{{ output.standard_end_of_body_html }}}
5 changes: 5 additions & 0 deletions templates/header.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@
<div class="container">
<div class="row">
<section class="col-sm-7 col-xs-12">
{{#shownavdrawer}}
<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 mr-1 mb-3 btn-light bg-gray" 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>
</div>
{{/shownavdrawer}}
<h2 class="wb-inv">{{{ sitename }}}</h2>
<a class="app-name" href="{{{ wwwroot }}}">{{{ sitename }}}</a>
</section>
Expand Down
3 changes: 3 additions & 0 deletions templates/nav-drawer.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,8 @@
@template theme_gcweb/nav-drawer
}}
<div id="nav-drawer" data-region="drawer" class="d-print-none moodle-has-zindex {{^navdraweropen}}closed{{/navdraweropen}}" aria-hidden="{{#navdraweropen}}false{{/navdraweropen}}{{^navdraweropen}}true{{/navdraweropen}}" tabindex="-1">
<div data-region="drawer-toggle" class="icon-size-5 nav-drawer-chevron-button" aria-expanded="{{#navdraweropen}}true{{/navdraweropen}}{{^navdraweropen}}false{{/navdraweropen}}" aria-controls="nav-drawer" data-action="toggle-drawer" data-side="left" data-preference="drawer-open-nav">
<i class="icon fa fa-angle-double-left"></i>
</div>
{{> theme_boost/flat_navigation }}
</div>
5 changes: 0 additions & 5 deletions templates/navbar.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,4 @@
}}
<div id="navbar" class="context-header-settings-menu">
{{{ output.settings_menu }}} {{{ pagebutton }}}
{{#shownavdrawer}}
<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-right mr-1 btn-light bg-gray" 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>
</div>
{{/shownavdrawer}}
</div>

0 comments on commit 4f6396e

Please sign in to comment.