Skip to content

Commit 208fd0b

Browse files
committed
Change search result panel to stay open until search cleared
1 parent e4550a6 commit 208fd0b

File tree

2 files changed

+18
-10
lines changed

2 files changed

+18
-10
lines changed

devtools/test_dashboard/devtools.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
var Fuse = require('fuse.js');
2-
var mocks = require('./mocks.json');
2+
var mocks = require('../../build/test_dashboard_mocks.json');
33

44

55
// Our gracious testing object
@@ -127,6 +127,7 @@ var f = new Fuse(mocks, {
127127

128128
var searchBar = document.getElementById('mocks-search');
129129
var mocksList = document.getElementById('mocks-list');
130+
var plotArea = document.getElementById('plots');
130131

131132
searchBar.addEventListener('keyup', function(e) {
132133

@@ -148,15 +149,11 @@ searchBar.addEventListener('keyup', function(e) {
148149
// Clear plots and plot selected.
149150
Tabs.purge();
150151
Tabs.plotMock(r.file.slice(0, -5));
151-
152-
// Clear results.
153-
while(mocksList.firstChild) {
154-
mocksList.removeChild(mocksList.firstChild);
155-
}
156-
157-
e.target.value = '';
158152
});
159153

160154
mocksList.appendChild(result);
155+
156+
var listWidth = mocksList.getBoundingClientRect.width;
157+
plotArea.setAttribute('width', window.innerWidth - listWidth);
161158
});
162159
});

devtools/test_dashboard/style.css

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
html, body{
22
margin: 0;
3-
padding: 0;
3+
padding: 40px 0 0 0;
44
font-family: helvetica, arial, sans-serif;
5+
background-color: #fafafa;
56
}
67
header{
8+
position: fixed;
9+
top: 0;
710
height: 40px;
11+
width: 100%;
812
border-bottom: 1px solid #4983EC;
13+
background-color: #ffffff;
14+
z-index: 100000;
915
}
1016
header img{
1117
height: 100%;
@@ -28,14 +34,16 @@ header span{
2834
line-height: 40px;
2935
}
3036
#mocks-list{
31-
position: absolute;
37+
position: fixed;
3238
right: 0px;
3339
top: 40px;
40+
bottom: 0px;
3441
z-index: 100000;
3542
background-color: #fff;
3643
border-left: 1px solid #4983EC;
3744
border-bottom: 1px solid #4983EC;
3845
border-top: 1px solid #4983EC;
46+
overflow: scroll;
3947
}
4048
.search-result{
4149
display: block;
@@ -48,6 +56,9 @@ header span{
4856
color: #fff;
4957
background-color: #4983EC;
5058
}
59+
#plots{
60+
width: 100%;
61+
}
5162
.dashboard-plot{
5263
margin-bottom: 30px;
5364
max-width: 940px;

0 commit comments

Comments
 (0)