mirror of
https://github.com/moparisthebest/android.moparisthebest.org
synced 2024-12-26 09:28:52 -05:00
now layouts or pages can specify "sidebar: collapse" in the yaml front matter for an always collapsed sidebar
This commit is contained in:
parent
8abc271e5d
commit
8ff71da80a
@ -1,6 +1,6 @@
|
|||||||
{% capture root_url %}{{ site.root | strip_slash }}{% endcapture %}
|
{% capture root_url %}{{ site.root | strip_slash }}{% endcapture %}
|
||||||
{% include head.html %}
|
{% include head.html %}
|
||||||
<body {% if page.body_id %} id="{{ page.body_id }}" {% endif %} {% if page.sidebar == false %} class="no-sidebar" {% endif %}>
|
<body {% if page.body_id %} id="{{ page.body_id }}" {% endif %} {% if page.sidebar == false %} class="no-sidebar" {% endif %} {% if page.sidebar == 'collapse' %} class="collapse-sidebar sidebar-footer" {% endif %}>
|
||||||
<header role="banner">{% include header.html %}</header>
|
<header role="banner">{% include header.html %}</header>
|
||||||
<nav role="navigation">{% include navigation.html %}</nav>
|
<nav role="navigation">{% include navigation.html %}</nav>
|
||||||
<div id="main">
|
<div id="main">
|
||||||
|
@ -11,6 +11,7 @@ function getNav() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function addSidebarToggler() {
|
function addSidebarToggler() {
|
||||||
|
if(!$('body').hasClass('sidebar-footer')) {
|
||||||
$('#content').append('<span class="toggle-sidebar"></span>');
|
$('#content').append('<span class="toggle-sidebar"></span>');
|
||||||
$('.toggle-sidebar').bind('click', function(e) {
|
$('.toggle-sidebar').bind('click', function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
@ -20,6 +21,7 @@ function addSidebarToggler() {
|
|||||||
$('body').addClass('collapse-sidebar');
|
$('body').addClass('collapse-sidebar');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
var sections = $('aside.sidebar > section');
|
var sections = $('aside.sidebar > section');
|
||||||
if (sections.length > 1) {
|
if (sections.length > 1) {
|
||||||
sections.each(function(section, index){
|
sections.each(function(section, index){
|
||||||
|
Loading…
Reference in New Issue
Block a user