From 25f36d8e32bb66e5ddfcba969f5a99baf2a9bd57 Mon Sep 17 00:00:00 2001 From: psychobunny Date: Wed, 26 Aug 2015 17:36:44 -0400 Subject: [PATCH] new profile header on mobile menu --- less/mobile.less | 35 ++++++++++++++++++----------------- lib/persona.js | 23 ++++++----------------- templates/header.tpl | 25 ++++++++++++++----------- 3 files changed, 38 insertions(+), 45 deletions(-) diff --git a/less/mobile.less b/less/mobile.less index c3e9e49..4438ed4 100644 --- a/less/mobile.less +++ b/less/mobile.less @@ -19,6 +19,7 @@ } #menu { + padding-top: 100px; background-color: #1D1F20; background-image: linear-gradient(145deg, #1D1F20, #404348); @@ -114,29 +115,29 @@ height: 100%; } - .menu-submenu { + .menu-profile { text-align: center; - padding-top: 15px; - - span { - margin: 5px; - position: relative; - - i { - position: absolute; - right: -3px; - top: -6px; - } - } + background: #101010; + position: fixed; + height: 75px; + width: 100%; + top: 0px; + z-index: 1; img { - width: 45px; - height: 45px; + position: absolute; + bottom: -22px; + left: 93px; + width: 70px; + height: 70px; border-radius: 50%; } - &.active img { - border: 2px solid white; + i { + position: absolute; + left: 145px; + font-size: 21px; + top: 28px; } } } \ No newline at end of file diff --git a/lib/persona.js b/lib/persona.js index 4f37bd0..c847a33 100644 --- a/lib/persona.js +++ b/lib/persona.js @@ -168,6 +168,12 @@ $(document).ready(function() { }); $('#mobile-menu').on('click', function() { + if (!slideout.isOpen()) { + require(['chat'], function(chat) { + chat.loadChats($('#menu [data-section="chats"] ul')); + }); + } + slideout.toggle(); }); @@ -200,22 +206,5 @@ $(document).ready(function() { $('#menu [data-section="navigation"] ul').html($('#main-nav').html()); $('#menu [data-section="profile"] ul').html($('#user-control-list').html()) .find('[component="user/status"]').remove(); - - $('#menu [data-submenu]').each(function() { - var submenuEl = $(this), - submenu = submenuEl.attr('data-submenu'); - - submenuEl.on('click', function() { - $('#menu [data-section]').addClass('hide'); - $('#menu [data-section="' + submenu + '"]').removeClass('hide'); - - if (submenu === 'chats') { - require(['chat'], function(chat) { - chat.loadChats($('#menu [data-section="chats"] ul')); - }); - } - - }); - }); } }); \ No newline at end of file diff --git a/templates/header.tpl b/templates/header.tpl index 1df6263..87ad6e8 100644 --- a/templates/header.tpl +++ b/templates/header.tpl @@ -39,27 +39,30 @@