move slideout and chat menus to partials

main
Julian Lam 6 years ago
parent 06a19b425c
commit d4b20749d6

@ -14,6 +14,10 @@ $(document).ready(function() {
$(window).on('resize', utils.debounce(configureNavbarHiding, 200)); $(window).on('resize', utils.debounce(configureNavbarHiding, 200));
$(window).on('resize', fixHeaderPadding); $(window).on('resize', fixHeaderPadding);
$(window).on('action:app.loggedIn', function () {
setupMobileMenu();
});
function fixHeaderPadding() { function fixHeaderPadding() {
var env = utils.findBootstrapEnvironment(); var env = utils.findBootstrapEnvironment();
if (env === 'sm' || env === 'xs' || env === 'md') { if (env === 'sm' || env === 'xs' || env === 'md') {

@ -26,50 +26,10 @@
<body class="{bodyClass} skin-{config.bootswatchSkin}"> <body class="{bodyClass} skin-{config.bootswatchSkin}">
<nav id="menu" class="slideout-menu hidden"> <nav id="menu" class="slideout-menu hidden">
<div class="menu-profile"> <!-- IMPORT partials/slideout-menu.tpl -->
<!-- IF user.uid -->
<!-- IF user.picture -->
<img src="{user.picture}"/>
<!-- ELSE -->
<div class="user-icon" style="background-color: {user.icon:bgColor};">{user.icon:text}</div>
<!-- ENDIF user.picture -->
<i component="user/status" class="fa fa-fw fa-circle status {user.status}"></i>
<!-- ENDIF user.uid -->
</div>
<section class="menu-section" data-section="navigation">
<h3 class="menu-section-title">[[global:header.navigation]]</h3>
<ul class="menu-section-list"></ul>
</section>
<!-- IF config.loggedIn -->
<section class="menu-section" data-section="profile">
<h3 class="menu-section-title">[[global:header.profile]]</h3>
<ul class="menu-section-list" component="header/usercontrol"></ul>
</section>
<section class="menu-section" data-section="notifications">
<h3 class="menu-section-title">
[[global:header.notifications]]
<span class="counter unread-count" component="notifications/icon" data-content="{unreadCount.notification}"></span>
</h3>
<ul class="menu-section-list notification-list-mobile" component="notifications/list"></ul>
<p class="menu-section-list"><a href="{relative_path}/notifications">[[notifications:see_all]]</a></p>
</section>
<!-- ENDIF config.loggedIn -->
</nav> </nav>
<nav id="chats-menu" class="slideout-menu hidden"> <nav id="chats-menu" class="slideout-menu hidden">
<!-- IF config.loggedIn --> <!-- IMPORT partials/chats-menu.tpl -->
<section class="menu-section" data-section="chats">
<h3 class="menu-section-title">
[[global:header.chats]]
<i class="counter unread-count" component="chat/icon" data-content="{unreadCount.chat}"></i>
</h3>
<ul class="menu-section-list chat-list" component="chat/list">
<a class="navigation-link" href="{relative_path}/user/{user.userslug}/chats">[[modules:chat.see_all]]</a>
</ul>
</section>
<!-- ENDIF config.loggedIn -->
</nav> </nav>
<main id="panel" class="slideout-panel"> <main id="panel" class="slideout-panel">

@ -0,0 +1,11 @@
<!-- IF config.loggedIn -->
<section class="menu-section" data-section="chats">
<h3 class="menu-section-title">
[[global:header.chats]]
<i class="counter unread-count" component="chat/icon" data-content="{unreadCount.chat}"></i>
</h3>
<ul class="menu-section-list chat-list" component="chat/list">
<a class="navigation-link" href="{relative_path}/user/{user.userslug}/chats">[[modules:chat.see_all]]</a>
</ul>
</section>
<!-- ENDIF config.loggedIn -->

@ -0,0 +1,31 @@
<div class="menu-profile">
<!-- IF user.uid -->
<!-- IF user.picture -->
<img src="{user.picture}"/>
<!-- ELSE -->
<div class="user-icon" style="background-color: {user.icon:bgColor};">{user.icon:text}</div>
<!-- ENDIF user.picture -->
<i component="user/status" class="fa fa-fw fa-circle status {user.status}"></i>
<!-- ENDIF user.uid -->
</div>
<section class="menu-section" data-section="navigation">
<h3 class="menu-section-title">[[global:header.navigation]]</h3>
<ul class="menu-section-list"></ul>
</section>
<!-- IF config.loggedIn -->
<section class="menu-section" data-section="profile">
<h3 class="menu-section-title">[[global:header.profile]]</h3>
<ul class="menu-section-list" component="header/usercontrol"></ul>
</section>
<section class="menu-section" data-section="notifications">
<h3 class="menu-section-title">
[[global:header.notifications]]
<span class="counter unread-count" component="notifications/icon" data-content="{unreadCount.notification}"></span>
</h3>
<ul class="menu-section-list notification-list-mobile" component="notifications/list"></ul>
<p class="menu-section-list"><a href="{relative_path}/notifications">[[notifications:see_all]]</a></p>
</section>
<!-- ENDIF config.loggedIn -->
Loading…
Cancel
Save