-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aca5d6e
commit ea7d1b2
Showing
14 changed files
with
408 additions
and
338 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
@using DotNetNuke.Web.DDRMenu; | ||
@using System.Dynamic; | ||
@inherits DotNetNuke.Web.Razor.DotNetNukeWebPage<dynamic> | ||
|
||
<ul class="h-100" id="nav-desktop"> | ||
@RenderPages(Model.Source.root.Children) | ||
</ul> | ||
|
||
@helper RenderPages(IEnumerable<MenuNode> pages) | ||
{ | ||
if (!pages.Any()) | ||
{ | ||
return; | ||
} | ||
|
||
foreach (var page in pages) | ||
{ | ||
var hasChildren = page.HasChildren(); | ||
var attrTarget = !string.IsNullOrEmpty(page.Target) ? ("target=\"" + page.Target + "\"") :string.Empty; | ||
|
||
<li class="@(page.Selected ? "selected" : string.Empty)"> | ||
@if (page.Enabled) | ||
{ | ||
<a href="@page.Url" @attrTarget>@page.Text</a> | ||
} | ||
else | ||
{ | ||
<a href="javascript:void(0);" @attrTarget>@page.Text</a> | ||
} | ||
|
||
@if (hasChildren) | ||
{ | ||
<ul> | ||
@RenderPages(page.Children) | ||
</ul> | ||
} | ||
</li> | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<manifest> | ||
<template>MainMenu.txt</template> | ||
<template>RazorMenu.cshtml</template> | ||
</manifest> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
@using DotNetNuke.Web.DDRMenu; | ||
@using System.Dynamic; | ||
@inherits DotNetNuke.Web.Razor.DotNetNukeWebPage<dynamic> | ||
|
||
<span class="hamburger material-icons" id="nav-mobile"><i class="fa fa-2x fa-bars"></i></span> | ||
|
||
<nav class="nav-drill" id="nav-mobile"> | ||
<ul class="nav-items"> | ||
@RenderPages(Model.Source.root.Children) | ||
</ul> | ||
</nav> | ||
|
||
@helper RenderPages(IEnumerable<MenuNode> pages) | ||
{ | ||
if (!pages.Any()) | ||
{ | ||
return; | ||
} | ||
|
||
foreach (var page in pages) | ||
{ | ||
var hasChildren = page.HasChildren(); | ||
var pageDesc = Html.Raw(!string.IsNullOrEmpty(page.Description) ? ("<br/><span class=\"link-description\">" + @page.Description + "</span>") :string.Empty); | ||
var attrTarget = !string.IsNullOrEmpty(page.Target) ? ("target=\"" + page.Target + "\"") :string.Empty; | ||
|
||
<li class="nav-item @(hasChildren ? "nav-expand " : string.Empty)@(page.Selected ? "selected" : string.Empty)"> | ||
@if (page.Enabled) | ||
{ | ||
<a class="nav-link" href="@page.Url" @attrTarget>@page.Text @pageDesc</a> | ||
} | ||
else | ||
{ | ||
<a href="javascript:void(0);" @attrTarget>@page.Text @pageDesc</a> | ||
} | ||
|
||
@if (hasChildren) | ||
{ | ||
<a href="javascript:void(0);" class="nav-link nav-expand-link"><i class="fa fa-chevron-right"></i></a> | ||
<ul class="nav-items nav-expand-content"> | ||
<li class="nav-item"> | ||
<a class="nav-link nav-back-link" href="javascript:;"> | ||
<em class="fa fa-chevron-left mr-1"></em>Back to @page.Text | ||
</a> | ||
</li> | ||
@RenderPages(page.Children) | ||
</ul> | ||
} | ||
</li> | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<manifest> | ||
<template>RazorMenu.cshtml</template> | ||
</manifest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<header class="bg-secondary sticky-top"> | ||
<div class="container-fluid user-controls bg-light-grey"> | ||
<div class="container"> | ||
<div class="row justify-content-end"> | ||
<ul> | ||
<li><dnn:Login runat="server" id="dnnLogin" /></li> | ||
<li><dnn:User runat="server" id="dnnUser" /></li> | ||
<li style="display:none;"><dnn:Search runat="server" id="dnnSearch" ShowSite="false" ShowWeb="false" Submit="<i class='fa fa-search'></i>" /></li> | ||
<li style="display:none;"><dnn:Language runat="server" id="dnnLanguage" ShowMenu="false" ShowLinks="false" /></li> | ||
</ul> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="container-fluid"> | ||
<div class="container"> | ||
<div class="row nav-main"> | ||
<dnn:LOGO id="dnnLOGO" runat="server" /> | ||
<div class="col-auto ms-auto d-none d-xl-block"> | ||
<dnn:MENU id="menu_desktop" MenuStyle="menus/desktop" runat="server" NodeSelector="*,0,2"></dnn:MENU> | ||
</div> | ||
<div class="col-auto ms-auto d-flex align-items-center d-xl-none"> | ||
<dnn:MENU id="menu_mobile" MenuStyle="menus/mobile" runat="server" NodeSelector="*,0,2"></dnn:MENU> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</header> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +0,0 @@ | ||
jQuery( document ).ready(function($) { | ||
/* SlimMenu Prep */ | ||
$('#navigation').slimmenu({ | ||
resizeWidth: '800', | ||
collapserTitle: '', | ||
animSpeed: 0, | ||
easingEffect: null, | ||
indentChildren: false, | ||
childrenIndenter: ' ', | ||
expandIcon: '', | ||
collapseIcon: '' | ||
}); | ||
}); | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/*jshint esversion: 6 */ | ||
|
||
// add event listeners to expands | ||
const navExpand = [].slice.call(document.querySelectorAll('.nav-expand')); | ||
|
||
navExpand.forEach(item => { | ||
item.querySelector('.nav-expand-link').addEventListener('click', () => item.classList.add('active')); | ||
item.querySelector('.nav-back-link').addEventListener('click', () => item.classList.remove('active')); | ||
}); | ||
|
||
// setup and add overlay | ||
let overlay = document.createElement('div'); | ||
overlay.setAttribute('id', 'body-overlay'); | ||
document.body.appendChild(overlay).classList.add('d-none'); | ||
|
||
// target hamburger menu | ||
const responsiveMenu = document.getElementById('nav-mobile'); | ||
const bodyOverlay = document.getElementById('body-overlay'); | ||
|
||
responsiveMenu.addEventListener('click', function() { | ||
// toggle menu | ||
document.body.classList.toggle('nav-is-toggled'); | ||
bodyOverlay.classList.toggle('d-none'); | ||
}); | ||
|
||
// if overlay is clicked | ||
bodyOverlay.addEventListener('click', function(e) { | ||
// toggle menu and overlay | ||
document.body.classList.toggle('nav-is-toggled'); | ||
bodyOverlay.classList.toggle('d-none'); | ||
}); |
Oops, something went wrong.