From 137a24a8a6b1e2d1d45a191662cc2e27888cc1fb Mon Sep 17 00:00:00 2001 From: psychobunny Date: Wed, 26 Aug 2015 12:29:37 -0400 Subject: [PATCH 01/19] Revert "Revert "removed old slide-in code"" This reverts commit 3e712cafe10c6ec1146e9e6906a9b8dbb2408d89. --- less/mobile.less | 0 less/persona.less | 2 +- less/slide-menu.less | 50 ------------------------------------- lib/persona.js | 44 ++++---------------------------- templates/partials/menu.tpl | 4 +-- 5 files changed, 8 insertions(+), 92 deletions(-) create mode 100644 less/mobile.less delete mode 100644 less/slide-menu.less diff --git a/less/mobile.less b/less/mobile.less new file mode 100644 index 0000000..e69de29 diff --git a/less/persona.less b/less/persona.less index 10a013a..4c71a15 100644 --- a/less/persona.less +++ b/less/persona.less @@ -18,7 +18,7 @@ @import "posts_list"; @import "register"; -@import "slide-menu"; +@import "mobile"; @import "helpers"; @import "keyframes"; diff --git a/less/slide-menu.less b/less/slide-menu.less deleted file mode 100644 index 299dbca..0000000 --- a/less/slide-menu.less +++ /dev/null @@ -1,50 +0,0 @@ -@media (max-width: @screen-xs-max) { - #header-menu #nav-dropdown.navbar-slide-in { - width: 45%; - background: @gray-dark; - right: -45%; - min-height: 1000px; - position: fixed; - margin-top: -20px; - padding: 20px; - box-shadow: inset 2px 0px 12px black; - top: 0px; - - a, a:hover, a:focus, a:active { - color: @gray-lighter; - } - - > ul { - overflow: hidden; - - > li { - .transition(.40s ease-in-out transform); - transform: translate3d(-50px, 0, 0); - -webkit-transform: translate3d(-50px, 0, 0); - } - - border-bottom: 1px solid lighten(@gray-dark, 10%); - } - } - - #header-menu .navbar-nav>.active>a, - #header-menu .navbar-nav>.active>a:focus, - #header-menu .navbar-nav>.open>a, - #header-menu .navbar-nav>.open>a:focus { - background: inherit; - } - - body { - .transition(.40s ease-in-out transform); - - &.slide-in { - transform: translate3d(-45%, 0, 0); - -webkit-transform: translate3d(-45%, 0, 0); - - #header-menu #nav-dropdown.navbar-slide-in > ul > li { - transform: translate3d(0, 0, 0); - -webkit-transform: translate3d(0, 0, 0); - } - } - } -} \ No newline at end of file diff --git a/lib/persona.js b/lib/persona.js index 11c2c03..24eca0c 100644 --- a/lib/persona.js +++ b/lib/persona.js @@ -3,7 +3,8 @@ /*globals ajaxify, config, utils, NProgress*/ $(document).ready(function() { - setupSlideMenu(); + setupNProgress(); + setupTaskbar(); setupEditedByIcon(); setupPaginator(); @@ -15,50 +16,17 @@ $(document).ready(function() { }); } - function setupSlideMenu() { - $('[data-toggle="slide-in"]').on('click', function(ev) { - $('body').toggleClass('slide-in'); - - if ($('body').hasClass('slide-in')) { - var top = ($('html').scrollTop() || $('body').scrollTop()) + $('header-menu').height(), - transform = 'translate3d(0, ' + top + 'px, 0)'; - - $('#header-menu').css({ - '-webkit-transform': transform, - '-moz-transform': transform, - '-ms-transform': transform, - '-o-transform': transform, - 'transform': transform - }); - - $('html').css('overflow-y', 'hidden'); - } else { - $('body').one("webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend", function() { - $('#header-menu').css({ - '-webkit-transform': 'none', - '-moz-transform': 'none', - '-ms-transform': 'none', - '-o-transform': 'none', - 'transform': 'none' - }); - - $('html').css('overflow-y', ''); - }); - } - }); - + function setupNProgress() { $(window).on('action:ajaxify.start', function() { - if ($('body').hasClass('slide-in')) { - $('.navbar-header button').click(); - } - NProgress.set(0.7); }); $(window).on('action:ajaxify.end', function() { NProgress.done(); }); + } + function setupTaskbar() { $(window).on('filter:taskbar.push', function(ev, data) { data.options.className = 'taskbar-' + data.module; @@ -188,6 +156,4 @@ $(document).ready(function() { $(window).on('action:posts.loading', appendPageNumber); } - - }); \ No newline at end of file diff --git a/templates/partials/menu.tpl b/templates/partials/menu.tpl index 66e72c3..a071fe0 100644 --- a/templates/partials/menu.tpl +++ b/templates/partials/menu.tpl @@ -1,5 +1,5 @@ - +
diff --git a/templates/header.tpl b/templates/header.tpl index 2a823ca..aba3202 100644 --- a/templates/header.tpl +++ b/templates/header.tpl @@ -38,10 +38,22 @@ -