SAAS-985 - Port sandwich menu to showbuilder branch

This commit is contained in:
Duncan Sommerville 2015-08-04 16:37:45 -04:00
parent 4200f56265
commit 57c1d74286
5 changed files with 72 additions and 19 deletions

View File

@ -50,20 +50,29 @@ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
</script> </script>
<div id="nav"> <div id="nav">
<div class="logo"></div> <div class="logo"></div>
<div class="personal-block solo"> <div class="personal-block solo">
<ol> <ol>
<li> <li>
<!-- <span class="trial-box-button"><a title="Billing" href=<?php echo $baseUrl . 'billing/upgrade'?>>Upgrade</a></span>&nbsp;--> <!-- <span class="trial-box-button"><a title="Billing" href=<?php echo $baseUrl . 'billing/upgrade'?>>Upgrade</a></span>&nbsp;-->
<a id="current-user" href=<?php echo $baseUrl . "User/edit-user"?>><span class="name"><?php echo $this->escape($this->loggedInAs()); ?></span></a> <a id="current-user" href=<?php echo $baseUrl . "user/edit-user"?>><span class="name"><?php echo $this->escape($this->loggedInAs()); ?></span></a>
| <a href=<?php echo $baseUrl . "Login/logout"?>><?php echo _("Logout")?></a> | <a href=<?php echo $baseUrl . "login/logout"?>><?php echo _("Logout")?></a>
</li> </li>
</ol> </ol>
</div> </div>
<div id="mobile-nav">
<div class="menu-btn" id="menu-btn">
<div></div>
<span></span>
<span></span>
<span></span>
</div>
</div>
<div class="responsive-menu">
<?php echo $this->navigation()->menu() ?>
</div>
<?php echo $this->navigation()->menu() ?>
<div style="clear:both;"></div> <div style="clear:both;"></div>
</div> </div>
<?php endif; //suspended ?> <?php endif; //suspended ?>

View File

@ -140,7 +140,7 @@ div.ColVis_collectionBackground {
@media screen and (max-width: 780px) { @media screen and (max-width: 780px) {
.wrapper { .wrapper {
height: 100% !important; /* Correct for margins */ height: 100% !important; /* Correct for margins */
padding: 0 15px 15px !important; padding: 0 !important;
} }
} }
@ -394,6 +394,8 @@ div.ColVis_collectionBackground {
flex: 1 auto; flex: 1 auto;
margin-right: 10px; margin-right: 10px;
text-align: center; text-align: center;
min-width: 555px;
} }
#media_type_nav div { #media_type_nav div {

View File

@ -340,6 +340,41 @@ fieldset {
width: 25%; 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) { @media screen and (max-width: 920px) {
.now-playing-block { .now-playing-block {
width: 50%; width: 50%;
@ -370,17 +405,6 @@ fieldset {
display: -webkit-flex; display: -webkit-flex;
width: 110px; 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) { @media screen and (max-width: 380px) {
.time-info-block { .time-info-block {

View File

@ -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();
}
});

View File

@ -480,6 +480,13 @@ function setCurrentUserPseudoPassword() {
$('#cu_passwordVerify').val("xxxxxx"); $('#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() { $(document).ready(function() {
if ($('#master-panel').length > 0) if ($('#master-panel').length > 0)
init(); init();
@ -502,4 +509,7 @@ $(document).ready(function() {
// text. This differs depending on the language setting // text. This differs depending on the language setting
$('#popup-link').css('width', $('.jp-container h1').css('width')); $('#popup-link').css('width', $('.jp-container h1').css('width'));
$('#menu-btn').click(function() {
$('#nav .responsive-menu').slideToggle();
});
}); });