From 57c1d742864bc32d2107d61063283ded051add24 Mon Sep 17 00:00:00 2001 From: Duncan Sommerville Date: Tue, 4 Aug 2015 16:37:45 -0400 Subject: [PATCH] SAAS-985 - Port sandwich menu to showbuilder branch --- .../application/layouts/scripts/layout.phtml | 23 +++++++--- airtime_mvc/public/css/_showbuilder.css | 4 +- airtime_mvc/public/css/styles.css | 46 ++++++++++++++----- .../public/js/airtime/common/common.js | 8 ++++ .../public/js/airtime/dashboard/dashboard.js | 10 ++++ 5 files changed, 72 insertions(+), 19 deletions(-) diff --git a/airtime_mvc/application/layouts/scripts/layout.phtml b/airtime_mvc/application/layouts/scripts/layout.phtml index 8192b474e..71c974024 100644 --- a/airtime_mvc/application/layouts/scripts/layout.phtml +++ b/airtime_mvc/application/layouts/scripts/layout.phtml @@ -50,20 +50,29 @@ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= - diff --git a/airtime_mvc/public/css/_showbuilder.css b/airtime_mvc/public/css/_showbuilder.css index a743d81ca..e454979c5 100644 --- a/airtime_mvc/public/css/_showbuilder.css +++ b/airtime_mvc/public/css/_showbuilder.css @@ -140,7 +140,7 @@ div.ColVis_collectionBackground { @media screen and (max-width: 780px) { .wrapper { height: 100% !important; /* Correct for margins */ - padding: 0 15px 15px !important; + padding: 0 !important; } } @@ -394,6 +394,8 @@ div.ColVis_collectionBackground { flex: 1 auto; margin-right: 10px; text-align: center; + + min-width: 555px; } #media_type_nav div { diff --git a/airtime_mvc/public/css/styles.css b/airtime_mvc/public/css/styles.css index eb302fb71..a10cfa2bd 100644 --- a/airtime_mvc/public/css/styles.css +++ b/airtime_mvc/public/css/styles.css @@ -340,6 +340,41 @@ fieldset { width: 25%; } } +@media screen and (max-width: 970px) { + #nav { + height: inherit; + overflow-y: visible; + } + #nav .responsive-menu { + position: absolute; + left: 0; + background: #353535; + width: 120px; + display: none; + + -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.5); + -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.5); + box-shadow: 0 5px 10px rgba(0, 0, 0, 0.5); + } + .mobile-nav { + display: block; + } + #menu-btn { + width: 24px; + + margin: 0; + + cursor: pointer; + } + #menu-btn span { + display: block; + width: 19px; + height: 3px; + margin: 4px 2px; + background: #efefef; + z-index: 99; + } +} @media screen and (max-width: 920px) { .now-playing-block { width: 50%; @@ -370,17 +405,6 @@ fieldset { display: -webkit-flex; width: 110px; } - .personal-block.solo { - float: none; - text-align: left; - } - .personal-block.solo ol { - padding-left: 12px; - } - .logo { - float: none; - margin-left: 12px; - } } @media screen and (max-width: 380px) { .time-info-block { diff --git a/airtime_mvc/public/js/airtime/common/common.js b/airtime_mvc/public/js/airtime/common/common.js index 46c016bf3..1a404dbe2 100644 --- a/airtime_mvc/public/js/airtime/common/common.js +++ b/airtime_mvc/public/js/airtime/common/common.js @@ -186,3 +186,11 @@ function getUsabilityHint() { } }); } + +$(document).mouseup(function (e) { + var mb = $("#menu-btn"), + w = $(window).width(); + if (!mb.is(e.target) && mb.has(e.target).length === 0 && w <= 970) { + $('#nav .responsive-menu').slideUp(); + } +}); \ No newline at end of file diff --git a/airtime_mvc/public/js/airtime/dashboard/dashboard.js b/airtime_mvc/public/js/airtime/dashboard/dashboard.js index 2f3cc0ae5..34bdd728d 100644 --- a/airtime_mvc/public/js/airtime/dashboard/dashboard.js +++ b/airtime_mvc/public/js/airtime/dashboard/dashboard.js @@ -480,6 +480,13 @@ function setCurrentUserPseudoPassword() { $('#cu_passwordVerify').val("xxxxxx"); } +$(window).resize(function() { + /* If we don't do this, the menu can stay hidden after resizing */ + if ($(this).width() > 970) { + $("#nav .responsive-menu").show(); + } +}); + $(document).ready(function() { if ($('#master-panel').length > 0) init(); @@ -502,4 +509,7 @@ $(document).ready(function() { // text. This differs depending on the language setting $('#popup-link').css('width', $('.jp-container h1').css('width')); + $('#menu-btn').click(function() { + $('#nav .responsive-menu').slideToggle(); + }); });