Merge pull request #58 from mcatominey/mobile-menu-fix

Fixed collapse button on mobile menu: included missing bootstrap js
This commit is contained in:
Justin Walsh 2013-08-05 05:12:44 -07:00
commit f540c54482
7 changed files with 56 additions and 12 deletions

View File

@ -6508,8 +6508,15 @@ body {
display: block; display: block;
} }
} }
@media (max-width: 480px) { @media (max-width: 768px) {
.sub-nav-collapse {
display: none;
}
}
@media (min-width: 768px) {
.sub-nav-collapse {
display: block;
}
} }
@media only screen and (max-width: 800px) { @media only screen and (max-width: 800px) {
/* Force table to not be like tables anymore */ /* Force table to not be like tables anymore */

View File

@ -6508,8 +6508,15 @@ body {
display: block; display: block;
} }
} }
@media (max-width: 480px) { @media (max-width: 768px) {
.sub-nav-collapse {
display: none;
}
}
@media (min-width: 768px) {
.sub-nav-collapse {
display: block;
}
} }
@media only screen and (max-width: 800px) { @media only screen and (max-width: 800px) {
/* Force table to not be like tables anymore */ /* Force table to not be like tables anymore */

View File

@ -6508,8 +6508,15 @@ body {
display: block; display: block;
} }
} }
@media (max-width: 480px) { @media (max-width: 768px) {
.sub-nav-collapse {
display: none;
}
}
@media (min-width: 768px) {
.sub-nav-collapse {
display: block;
}
} }
@media only screen and (max-width: 800px) { @media only screen and (max-width: 800px) {
/* Force table to not be like tables anymore */ /* Force table to not be like tables anymore */

View File

@ -6508,8 +6508,15 @@ body {
display: block; display: block;
} }
} }
@media (max-width: 480px) { @media (max-width: 768px) {
.sub-nav-collapse {
display: none;
}
}
@media (min-width: 768px) {
.sub-nav-collapse {
display: block;
}
} }
@media only screen and (max-width: 800px) { @media only screen and (max-width: 800px) {
/* Force table to not be like tables anymore */ /* Force table to not be like tables anymore */

View File

@ -126,6 +126,7 @@ if ($homepage && $homepage_url !== '/') {
<!-- Navigation --> <!-- Navigation -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.0/jquery.min.js"></script> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.0/jquery.min.js"></script>
<script src="<?php echo $base_url ?>/js/bootstrap.min.js"></script>
<script src="<?php echo $base_url ?>/js/custom.js"></script> <script src="<?php echo $base_url ?>/js/custom.js"></script>
<!--[if lt IE 9]> <!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
@ -237,13 +238,13 @@ if ($homepage && $homepage_url !== '/') {
<div class="left-column article-tree span3"> <div class="left-column article-tree span3">
<!-- For Mobile --> <!-- For Mobile -->
<div class="responsive-collapse"> <div class="responsive-collapse">
<button type="button" class="btn btn-sidebar" data-toggle="collapse" data-target="#sub-nav-collapse"> <button type="button" class="btn btn-sidebar" id="menu-spinner-button">
<span class="icon-bar"></span> <span class="icon-bar"></span>
<span class="icon-bar"></span> <span class="icon-bar"></span>
<span class="icon-bar"></span> <span class="icon-bar"></span>
</button> </button>
</div> </div>
<div id="sub-nav-collapse" class="collapse in"> <div id="sub-nav-collapse" class="sub-nav-collapse">
<!-- Navigation --> <!-- Navigation -->
<?php echo build_nav($tree); ?> <?php echo build_nav($tree); ?>

View File

@ -7,4 +7,16 @@ $(function() {
// Bootstrap Table Class // Bootstrap Table Class
$('table').addClass('table'); $('table').addClass('table');
// Responsive menu spinner
$('#menu-spinner-button').click(function() {
$('#sub-nav-collapse').slideToggle();
});
// Catch browser resize
$(window).resize(function() {
// Remove transition inline style on large screens
if ($(window).width() >= 768)
$('#sub-nav-collapse').removeAttr('style');
});
}); });

View File

@ -265,8 +265,11 @@ html, body {
} }
} }
.sub-nav-collapse { .sub-nav-collapse {
@media (max-width: 480px) { @media (max-width: 768px) {
//display: none; display: none;
}
@media (min-width: 768px) {
display: block;
} }
} }