Skip to content

Commit 9a5f577

Browse files
author
AMJones
committed
Corrects issues with drawer collapse indicator on systems without scrollbars.
1 parent 33a4084 commit 9a5f577

File tree

6 files changed

+38
-15
lines changed

6 files changed

+38
-15
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"css"
1111
],
1212
"homepage": "https://www.github.com/strapless/drawer",
13-
"version": "2.0",
13+
"version": "2.0.1",
1414
"authors": [
1515
{
1616
"name": "Aaron M Jones",

dist/css/drawer.css

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* StrapLess Drawer v2.0 (http://github.com/strapless/drawer)
2+
* StrapLess Drawer v2.0.1 (http://github.com/strapless/drawer)
33
* Licensed under MIT (https://github.com/strapless/drawer/blob/master/LICENSE)
44
*/
55
.drawer {
@@ -182,6 +182,7 @@ html.on header.header-fixed-top {
182182
}
183183

184184
.drawer-group {
185+
max-width: 230px;
185186
margin: .25rem 0 0 0;
186187
padding: 0;
187188
border: 0 solid rgba(33, 37, 41, 0.125);
@@ -232,6 +233,10 @@ html.on header.header-fixed-top {
232233
flex: 1 0 100%;
233234
}
234235

236+
.drawer-group.drawer-group-collapse [data-toggle="collapse-group"] {
237+
cursor: pointer;
238+
}
239+
235240
.drawer-group.drawer-group-collapse [data-toggle="collapse-group"] > .drawer-item-heading {
236241
position: relative;
237242
}
@@ -241,6 +246,14 @@ html.on header.header-fixed-top {
241246
width: 8px;
242247
height: 8px;
243248
content: " ";
249+
-webkit-transform-origin: center center;
250+
-ms-transform-origin: center center;
251+
transform-origin: center center;
252+
transition-duration: 0.35s;
253+
position: absolute;
254+
right: 1rem;
255+
top: 50%;
256+
margin-top: -4px;
244257
background: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%228%22%20height%3D%228%22%20viewBox%3D%220%200%208%208%22%3E%3Cpath%20fill%3D%22rgba%280%2C%200%2C%200%2C%200.5%29%22%20d%3D%22M4%200l-4%204%201.5%201.5%202.5-2.5%202.5%202.5%201.5-1.5-4-4z%22%20transform%3D%22translate%280%201%29%22%20%2F%3E%3C%2Fsvg%3E") center center/8px 8px no-repeat;
245258
}
246259

dist/css/drawer.min.css

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/js/drawer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jQuery.fn.extend( {
6262
/**
6363
* jQuery Plugin for managing a navigation drawer.
6464
*
65-
* @version v2.0
65+
* @version v2.0.1
6666
* @license https://github.com/strapless/strapless/LICENSE
6767
* @author Aaron M Jones <am@jonesiscoding.com>
6868
*/

js/drawer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* jQuery Plugin for managing a navigation drawer.
33
*
4-
* @version v2.0
4+
* @version v2.0.1
55
* @license https://github.com/strapless/strapless/LICENSE
66
* @author Aaron M Jones <am@jonesiscoding.com>
77
*/

scss/_drawer.scss

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
@if not($enable-framework) {
55
/*!
6-
* StrapLess Drawer v2.0 (http://github.com/strapless/drawer)
6+
* StrapLess Drawer v2.0.1 (http://github.com/strapless/drawer)
77
* Licensed under MIT (https://github.com/strapless/drawer/blob/master/LICENSE)
88
*/
99
}
@@ -144,6 +144,7 @@ html.on {
144144

145145
// Drawer Groups & Items
146146
.drawer-group {
147+
max-width: $drawer-width;
147148
// Separator between groups
148149
margin: .25rem 0 0 0;
149150
padding: 0; // Any padding causes bounce on collapse
@@ -174,14 +175,23 @@ html.on {
174175
text-overflow: ellipsis;
175176
flex: 1 0 100%;
176177
}
177-
[data-toggle="collapse-group"] > .drawer-item-heading {
178-
position: relative;
179-
&::before {
180-
display: block;
181-
width: $drawer-indicator-size;
182-
height: $drawer-indicator-size;
183-
content: " ";
184-
background: inline-svg($drawer-chevron) center center / $drawer-indicator-size $drawer-indicator-size no-repeat;
178+
[data-toggle="collapse-group"] {
179+
cursor: pointer;
180+
> .drawer-item-heading {
181+
position: relative;
182+
&::before {
183+
display: block;
184+
width: $drawer-indicator-size;
185+
height: $drawer-indicator-size;
186+
content: " ";
187+
transform-origin: center center;
188+
transition-duration: 0.35s;
189+
position: absolute;
190+
right: 1rem;
191+
top: 50%; // Needed for Safari 10, IE10/11
192+
margin-top: -4px; // Needed for Safari 10, IE10/11
193+
background: inline-svg($drawer-chevron) center center / $drawer-indicator-size $drawer-indicator-size no-repeat;
194+
}
185195
}
186196
}
187197
}

0 commit comments

Comments
 (0)