diff --git a/app/views/layouts/base.html.erb b/app/views/layouts/base.html.erb
index 6c5a9b2..fc3f4a6 100644
--- a/app/views/layouts/base.html.erb
+++ b/app/views/layouts/base.html.erb
@@ -7,6 +7,7 @@
 <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
 <meta name="description" content="<%= Redmine::Info.app_name %>" />
 <meta name="keywords" content="issue,bug,tracker" />
+<meta property="rails-url-root" content="<%= Redmine::Utils.relative_url_root.presence || "/" %>" />
 <%= csrf_meta_tag %>
 <%= favicon %>
 <%= stylesheet_link_tag 'jquery/jquery-ui-1.11.0', 'application', 'responsive', :media => 'all' %>
@@ -99,9 +100,12 @@
 </div>
 
 <div id="main" class="<%= sidebar_content? ? '' : 'nosidebar' %>">
-    <div id="sidebar">
+    <div id="sidebar" class="<%= cookies['sidebar_collapse'] == 'true' ? 'hidden' : '' %>">
+      <a id="sidebar-toggle" href="#"></a>
+      <div class="sidebar-wrapper">
         <%= yield :sidebar %>
         <%= view_layouts_base_sidebar_hook_response %>
+      </div>
     </div>
 
     <div id="content">
diff --git a/public/javascripts/application.js b/public/javascripts/application.js
index eedeae0..173b744 100644
--- a/public/javascripts/application.js
+++ b/public/javascripts/application.js
@@ -781,3 +781,11 @@ $(document).ready(hideOnLoad);
 $(document).ready(addFormObserversForDoubleSubmit);
 $(document).ready(defaultFocus);
 $(document).ready(setupTabs);
+$(document).ready(function () {
+  $('#sidebar-toggle').click(function () {
+    $('#sidebar').toggleClass('hidden');
+    document.cookie = 'sidebar_collapse=' + $('#sidebar').hasClass('hidden') +
+      '; path=' + $('meta[property="rails-url-root"]').attr('content');
+    return false;
+  });
+});
diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css
index 598939c..11b1032 100644
--- a/public/stylesheets/application.css
+++ b/public/stylesheets/application.css
@@ -95,7 +95,19 @@ pre, code {font-family: Consolas, Menlo, "Liberation Mono", Courier, monospace;}
 
 #main {background-color:#EEEEEE;}
 
-#sidebar{ float: right; width: 22%; position: relative; z-index: 9; padding: 0; margin: 0;}
+#sidebar{
+  position: relative;
+  float: right;
+  width: 22%;
+  z-index: 9;
+  padding: 0 0 0 16px;
+  transition-duration: 0.5s;
+  margin: 0;
+}
+#sidebar .sidebar-wrapper {
+  padding-left: 10px;
+  transition-duration: 0;
+}
 * html #sidebar{ width: 22%; }
 #sidebar h3{ font-size: 14px; margin-top:14px; color: #666;  }
 #sidebar hr{ width: 100%; margin: 0 auto; height: 1px; background: #ccc; border: 0; }
@@ -105,8 +117,30 @@ pre, code {font-family: Consolas, Menlo, "Liberation Mono", Courier, monospace;}
 #sidebar ul li, ul.flat li {list-style-type:none;margin: 0px 2px 0px 0px; padding: 0px 0px 0px 0px;}
 #sidebar div.wiki ul {margin:inherit; padding-left:40px;}
 #sidebar div.wiki ul li {list-style-type:inherit;}
+#sidebar.hidden { margin-right: -22%; }
+#sidebar a#sidebar-toggle {
+  position: absolute;
+  top: 0;
+  left: -6px;
+  width: 20px;
+  height: 30px;
+  font-size: 1em;
+  font-weight: bold;
+  border: 1px solid #ccc;
+  border-radius: 0 0 3px 3px;
+  background: #eee url(../images/bullet_arrow_right.png) no-repeat 50% 50%;
+}
+#sidebar a#sidebar-toggle:focus {
+  outline: 0;
+}
+#sidebar.hidden a#sidebar-toggle {
+  background: #eee url(../images/bullet_arrow_left.png) no-repeat 50% 50%;
+}
+#sidebar a#sidebar-toggle:hover {
+  background-color: #f5f5f5;
+}
 
-#content { width: 75%; background-color: #fff; margin: 0px; border-right: 1px solid #ddd; padding: 6px 10px 10px 10px; z-index: 10; }
+#content { overflow: hidden; background-color: #fff; margin: 0px; border-right: 1px solid #ddd; padding: 6px 10px 10px 10px; z-index: 10; }
 * html #content{ width: 75%; padding-left: 0; margin-top: 0px; padding: 6px 10px 10px 10px;}
 html>body #content { min-height: 600px; }
 * html body #content { height: 600px; } /* IE */
diff --git a/public/themes/alternate/stylesheets/application.css b/public/themes/alternate/stylesheets/application.css
index 4ad6b79..585a8ae 100644
--- a/public/themes/alternate/stylesheets/application.css
+++ b/public/themes/alternate/stylesheets/application.css
@@ -6,6 +6,8 @@ body, #wrapper { background-color:#EEEEEE; }
 #content, #main.nosidebar #content { background: #fff; border-right: 1px solid #bbb; border-bottom: 1px solid #bbb; border-left: 1px solid #d7d7d7; border-top: 1px solid #d7d7d7; }
 #footer { background-color:#EEEEEE; border: 0px; }
 
+#sidebar.hidden .sidebar-wrapper { padding-left: 15px; }
+
 /* Headers */
 h2, h3, h4, .wiki h1, .wiki h2, .wiki h3 {border-bottom: 0px;}
 
diff --git a/public/themes/classic/stylesheets/application.css b/public/themes/classic/stylesheets/application.css
index 523104d..4e744fb 100644
--- a/public/themes/classic/stylesheets/application.css
+++ b/public/themes/classic/stylesheets/application.css
@@ -31,6 +31,8 @@ body{ color:#303030; background:#e8eaec; }
 #content { background: #fff; }
 #content .tabs ul { bottom:-1px; }
 
+#sidebar.hidden .sidebar-wrapper { padding-left: 15px; }
+
 h2, h3, h4, .wiki h1, .wiki h2, .wiki h3 { border-bottom: 0px; color:#606060; font-family: Trebuchet MS,Georgia,"Times New Roman",serif; }
 h2, .wiki h1 { letter-spacing:-1px; }
 h4 { border-bottom: dotted 1px #c0c0c0; }
