Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions javascripts/theme.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/**
* Add the sidebar toggle capability when the sidebar exists on the page.
* Requires jQuery cookie support to persist sidebar state.
*/
$.getScript('//cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js').done(function() {
var toggleSidebar = function() {
if ($('#main').hasClass('nosidebar')) {
$.removeCookie('hidesidebar', { path: '/' });
$('#main').removeClass('nosidebar');
$('#sidebar-toggle').html('»');
} else {
$.cookie('hidesidebar', '1', { path: '/' });
$('#main').addClass('nosidebar');
$('#sidebar-toggle').html('«');
}
};

if ($('#main').hasClass('nosidebar') === false) {
$('#main').append('<button id="sidebar-toggle" class="button">&raquo;</button>');
$('#sidebar-toggle').click(toggleSidebar);

if ($.cookie('hidesidebar') === '1') {
toggleSidebar();
}
}
});
10 changes: 9 additions & 1 deletion sass/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ tt, code, pre {
background: transparent;
margin: 15px 15px 0px 15px;
background-color: $background-color;
position: relative; /* Allows the "#sidebar-toggle" to be positioned inside of it. */
}

#sidebar-toggle {
position: absolute;
top: 0;
right: 0;
z-index: 10;
}

#top-menu {
Expand Down Expand Up @@ -202,7 +210,7 @@ p.breadcrumb {

div#content > div.contextual {
margin-top: 10px;
margin-right: 10px;
margin-right: 30px;
}

#roadmap {
Expand Down
6 changes: 4 additions & 2 deletions stylesheets/application.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ tt, code, pre { font-family: Consolas, "Liberation Mono", Courier, monospace; fo
#header a { color: #4183c4; }
#header > h1 { background: url(../images/logo.png) no-repeat 10px 5px; padding: 5px 45px; color: #393939; }

#main { background: transparent; margin: 15px 15px 0px 15px; background-color: white; }
#main { background: transparent; margin: 15px 15px 0px 15px; background-color: white; position: relative; }

#sidebar-toggle { position: absolute; top: 0; right: 0; z-index: 10; }

#top-menu { font: 12px Helvetica, arial, freesans, clean, sans-serif; padding: 10px 10px 2px 20px; background-color: #f3f3f3; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #f9f9f9), color-stop(100%, #f3f3f3)); background-image: -webkit-linear-gradient(#f9f9f9, #f3f3f3); background-image: -moz-linear-gradient(#f9f9f9, #f3f3f3); background-image: -o-linear-gradient(#f9f9f9, #f3f3f3); background-image: linear-gradient(#f9f9f9, #f3f3f3); background-repeat: repeat-x; text-shadow: 0 1px 0 white; border-bottom: 1px solid #e5e5e5; }
#top-menu #loggedas { color: #222; }
Expand Down Expand Up @@ -55,7 +57,7 @@ div#content h2.contacts_header { padding-bottom: 10px; /* white-space: nowrap;*/

p.breadcrumb { margin: 4px 0 14px 0; }

div#content > div.contextual { margin-top: 10px; margin-right: 10px; }
div#content > div.contextual { margin-top: 10px; margin-right: 30px; }

#roadmap { margin: 10px; }

Expand Down