Project

General

Profile

Feature #21808 » 0001-Make-sidebar-collapsible-r15746.patch

Rebased for 3.3-stable as of r15746 - Daniel Ritz, 2016-08-20 20:20

View differences:

app/views/layouts/base.html.erb
7 7
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
8 8
<meta name="description" content="<%= Redmine::Info.app_name %>" />
9 9
<meta name="keywords" content="issue,bug,tracker" />
10
<meta property="rails-url-root" content="<%= Redmine::Utils.relative_url_root.presence || "/" %>" />
10 11
<%= csrf_meta_tag %>
11 12
<%= favicon %>
12 13
<%= stylesheet_link_tag 'jquery/jquery-ui-1.11.0', 'application', 'responsive', :media => 'all' %>
......
99 100
</div>
100 101

  
101 102
<div id="main" class="<%= sidebar_content? ? '' : 'nosidebar' %>">
102
    <div id="sidebar">
103
    <div id="sidebar" class="<%= cookies['sidebar_collapse'] == 'true' ? 'hidden' : '' %>">
104
      <a id="sidebar-toggle" href="#"></a>
105
      <div class="sidebar-wrapper">
103 106
        <%= yield :sidebar %>
104 107
        <%= view_layouts_base_sidebar_hook_response %>
108
      </div>
105 109
    </div>
106 110

  
107 111
    <div id="content">
public/javascripts/application.js
781 781
$(document).ready(addFormObserversForDoubleSubmit);
782 782
$(document).ready(defaultFocus);
783 783
$(document).ready(setupTabs);
784
$(document).ready(function () {
785
  $('#sidebar-toggle').click(function () {
786
    $('#sidebar').toggleClass('hidden');
787
    document.cookie = 'sidebar_collapse=' + $('#sidebar').hasClass('hidden') +
788
      '; path=' + $('meta[property="rails-url-root"]').attr('content');
789
    return false;
790
  });
791
});
public/stylesheets/application.css
95 95

  
96 96
#main {background-color:#EEEEEE;}
97 97

  
98
#sidebar{ float: right; width: 22%; position: relative; z-index: 9; padding: 0; margin: 0;}
98
#sidebar{
99
  position: relative;
100
  float: right;
101
  width: 22%;
102
  z-index: 9;
103
  padding: 0 0 0 16px;
104
  transition-duration: 0.5s;
105
  margin: 0;
106
}
107
#sidebar .sidebar-wrapper {
108
  padding-left: 10px;
109
  transition-duration: 0;
110
}
99 111
* html #sidebar{ width: 22%; }
100 112
#sidebar h3{ font-size: 14px; margin-top:14px; color: #666;  }
101 113
#sidebar hr{ width: 100%; margin: 0 auto; height: 1px; background: #ccc; border: 0; }
......
105 117
#sidebar ul li, ul.flat li {list-style-type:none;margin: 0px 2px 0px 0px; padding: 0px 0px 0px 0px;}
106 118
#sidebar div.wiki ul {margin:inherit; padding-left:40px;}
107 119
#sidebar div.wiki ul li {list-style-type:inherit;}
120
#sidebar.hidden { margin-right: -22%; }
121
#sidebar a#sidebar-toggle {
122
  position: absolute;
123
  top: 0;
124
  left: -6px;
125
  width: 20px;
126
  height: 30px;
127
  font-size: 1em;
128
  font-weight: bold;
129
  border: 1px solid #ccc;
130
  border-radius: 0 0 3px 3px;
131
  background: #eee url(../images/bullet_arrow_right.png) no-repeat 50% 50%;
132
}
133
#sidebar a#sidebar-toggle:focus {
134
  outline: 0;
135
}
136
#sidebar.hidden a#sidebar-toggle {
137
  background: #eee url(../images/bullet_arrow_left.png) no-repeat 50% 50%;
138
}
139
#sidebar a#sidebar-toggle:hover {
140
  background-color: #f5f5f5;
141
}
108 142

  
109
#content { width: 75%; background-color: #fff; margin: 0px; border-right: 1px solid #ddd; padding: 6px 10px 10px 10px; z-index: 10; }
143
#content { overflow: hidden; background-color: #fff; margin: 0px; border-right: 1px solid #ddd; padding: 6px 10px 10px 10px; z-index: 10; }
110 144
* html #content{ width: 75%; padding-left: 0; margin-top: 0px; padding: 6px 10px 10px 10px;}
111 145
html>body #content { min-height: 600px; }
112 146
* html body #content { height: 600px; } /* IE */
public/themes/alternate/stylesheets/application.css
6 6
#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; }
7 7
#footer { background-color:#EEEEEE; border: 0px; }
8 8

  
9
#sidebar.hidden .sidebar-wrapper { padding-left: 15px; }
10

  
9 11
/* Headers */
10 12
h2, h3, h4, .wiki h1, .wiki h2, .wiki h3 {border-bottom: 0px;}
11 13

  
public/themes/classic/stylesheets/application.css
31 31
#content { background: #fff; }
32 32
#content .tabs ul { bottom:-1px; }
33 33

  
34
#sidebar.hidden .sidebar-wrapper { padding-left: 15px; }
35

  
34 36
h2, h3, h4, .wiki h1, .wiki h2, .wiki h3 { border-bottom: 0px; color:#606060; font-family: Trebuchet MS,Georgia,"Times New Roman",serif; }
35 37
h2, .wiki h1 { letter-spacing:-1px; }
36 38
h4 { border-bottom: dotted 1px #c0c0c0; }
(5-5/22)