Skip to content

Commit a83c873

Browse files
committed
with help from lucas, updated sidebar open,close logic to only switch a CSS class
1 parent 6cd729d commit a83c873

File tree

3 files changed

+14
-15
lines changed

3 files changed

+14
-15
lines changed

scout-ui/src/home/collection.jade

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,9 @@
1616
i.fa.fa-caret-left
1717
|
1818
i.fa.fa-file-text-o
19-
.column.side
19+
button.btn.btn-link.splitter-button.hidden
20+
i.fa.fa-file-text-o
21+
|
22+
i.fa.fa-caret-right
23+
.column.side(data-hook='collection-side')
2024
div(data-hook='documents-subview')

scout-ui/src/home/collection.js

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,17 @@ module.exports = AmpersandView.extend({
1717
default: false
1818
}
1919
},
20-
derived: {
21-
sidebarWidth: {
22-
deps: ['open'],
23-
fn: function() {
24-
return this.open ? 400 : 0;
25-
}
26-
}
27-
},
2820
events: {
2921
'click .splitter': 'onSplitterClick',
3022
},
3123
bindings: {
3224
'model._id': {
3325
hook: 'name'
3426
},
35-
'sidebarWidth': {
36-
type: function(el, value) {
37-
$(el).width(value);
38-
},
39-
selector: '.side'
27+
'open': {
28+
type: 'booleanClass',
29+
yes: 'is-open',
30+
hook: 'collection-side'
4031
}
4132
},
4233
children: {

scout-ui/src/home/index.less

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,15 @@
111111
}
112112

113113
.side {
114-
width: 350px;
114+
width: 0;
115115
font-family: @font-family-monospace;
116116
font-size: 11px;
117117
border-left: 2px solid @gray7;
118118
right: -12px;
119+
120+
&.is-open {
121+
width: 400px;
122+
}
119123
}
120124

121125
.splitter {

0 commit comments

Comments
 (0)