Skip to content

Commit 1653d17

Browse files
committed
Merge pull request #48 from 10gen/INT-312
INT-312 UI Interaction with Data Viewer sidebar
2 parents dd0e0fe + d622eee commit 1653d17

File tree

9 files changed

+70
-24
lines changed

9 files changed

+70
-24
lines changed

scout-style/index.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ html, body{
8686
width: 100%;
8787
height: 100%;
8888
border-radius: 50%;
89-
background-color: @green2;
89+
background-color: @mc-blue0;
9090
opacity: 0.6;
9191
position: absolute;
9292
top: 0;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
.list-group-item
1+
div
22
div(data-hook='doc-subview')
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
.list-group(data-hook='documents-container')
1+
div(data-hook='documents-container')

scout-ui/src/home/collection.jade

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,17 @@
88
.col-md-6
99
div(data-hook='stats-subview')
1010
div(data-hook='refine-bar')
11-
.column-container
11+
.column-container(data-hook='json-sidebar-toggle-class')
1212
.column.main
1313
div(data-hook='fields-subview')
14+
.splitter
15+
button.btn.btn-link.splitter-button.splitter-button-open
16+
i.fa.fa-caret-left
17+
|
18+
i.fa.fa-file-text-o
19+
button.btn.btn-link.splitter-button.splitter-button-close
20+
i.fa.fa-file-text-o
21+
|
22+
i.fa.fa-caret-right
1423
.column.side
15-
.splitter
16-
i.fa.fa-lg.fa-rotate-90.fa-sort
1724
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
@@ -20,26 +20,17 @@ module.exports = AmpersandView.extend({
2020
type: 'view'
2121
}
2222
},
23-
derived: {
24-
sidebarWidth: {
25-
deps: ['open'],
26-
fn: function() {
27-
return this.open ? 400 : 0;
28-
}
29-
}
30-
},
3123
events: {
3224
'click .splitter': 'onSplitterClick',
3325
},
3426
bindings: {
3527
'model._id': {
3628
hook: 'name'
3729
},
38-
'sidebarWidth': {
39-
type: function(el, value) {
40-
$(el).width(value);
41-
},
42-
selector: '.side'
30+
'open': {
31+
type: 'booleanClass',
32+
yes: 'sidebar-open',
33+
hook: 'json-sidebar-toggle-class'
4334
}
4435
},
4536
children: {

scout-ui/src/home/index.less

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@
8686
}
8787
}
8888
.column-container {
89-
padding-right: 20px;
9089
display: flex;
9190
overflow: hidden;
9291
height: 100vh;
@@ -103,6 +102,7 @@
103102
-webkit-overflow-scrolling: touch;
104103
-ms-overflow-style: none;
105104
position: relative;
105+
transition: width 250ms ease;
106106
}
107107

108108
.main {
@@ -111,14 +111,50 @@
111111
}
112112

113113
.side {
114-
width: 350px;
114+
width: 0;
115115
font-family: @font-family-monospace;
116116
font-size: 11px;
117+
border-left: 2px solid @gray7;
118+
right: -12px;
119+
top: 30px;
117120
}
118121

119122
.splitter {
120123
width: 20px;
121124
height: 20px;
125+
position: relative;
126+
right: 10px;
127+
transition: right 250ms ease;
128+
}
129+
.splitter-button {
130+
outline: none;
131+
color: @gray1;
132+
text-decoration: none;
133+
134+
&:hover {
135+
text-decoration: none;
136+
}
137+
&:active {
138+
outline: none;
139+
color: @green2;
140+
}
141+
}
142+
.splitter-button-close {
143+
display: none;
144+
}
145+
.column-container.sidebar-open {
146+
.side {
147+
width: 33%;
148+
}
149+
.splitter {
150+
right: -15px;
151+
}
152+
.splitter-button-open {
153+
display: none;
154+
}
155+
.splitter-button-close {
156+
display: inline-block;
157+
}
122158
}
123159
}
124160

scout-ui/src/object-tree/index.less

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222

2323
font-family: @font-family-monospace;
2424
font-size: 11px;
25+
padding-bottom: 10px;
26+
margin-bottom: 10px;
27+
border-bottom: 1px solid @gray7;
2528

2629
.jsobject {
2730
margin-left: 8px;
@@ -63,3 +66,12 @@ span.caret-placeholder {
6366
cursor: pointer;
6467
}
6568
}
69+
70+
// .truncate-jsprimvalue {
71+
// max-width: 75%;
72+
// overflow-x: hidden;
73+
// text-overflow: ellipsis;
74+
// display: inline-block;
75+
// white-space: nowrap;
76+
// margin-bottom: -4px;
77+
// }
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
.jsobject
1+
.jsobject.clearfix
22
div(data-hook='members-container')
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
span.jsprimvalue
22
if (typeof(model.value) === 'string')
3-
| "#{model.value}"
3+
| "#[span(class='truncate-jsprimvalue', title="#{model.value}") #{model.value}]"
44
else
5-
= model.value
5+
| #[span(class='truncate-jsprimvalue', title="#{model.value}") #{model.value}]

0 commit comments

Comments
 (0)