From 87a73c9d313a488dcea7549283ac05564d8c0c2b Mon Sep 17 00:00:00 2001 From: Daniel Ritz Date: Sat, 23 Jan 2016 21:42:34 +0100 Subject: [PATCH] Make sidebar collapsible * Adds the relative URL root as a meta property in the head tag * Adds a simple to the sidebar as collapse/expand button * Makes the .content a BFC taking the remaining width * Few lines of javascript to toggle CSS and set a cookie * Sidebar is hidden by setting its margin-right * Nice hiding animation using CSS for browsers that support it * The state of the sidebar is read from the cookie and applied on page load --- app/views/layouts/base.html.erb | 6 +++- public/javascripts/application.js | 8 +++++ public/stylesheets/application.css | 38 ++++++++++++++++++++-- .../themes/alternate/stylesheets/application.css | 2 ++ public/themes/classic/stylesheets/application.css | 2 ++ 5 files changed, 53 insertions(+), 3 deletions(-) diff --git a/app/views/layouts/base.html.erb b/app/views/layouts/base.html.erb index 68b6bd8..5785ca1 100644 --- a/app/views/layouts/base.html.erb +++ b/app/views/layouts/base.html.erb @@ -7,6 +7,7 @@ +" /> <%= csrf_meta_tag %> <%= favicon %> <%= stylesheet_link_tag 'jquery/jquery-ui-1.11.0', 'application', 'responsive', :media => 'all' %> @@ -99,9 +100,12 @@