Skip to content

Commit d804bf9

Browse files
Gary KeebleGary Keeble
authored andcommitted
Add ability to hide the analyser
Just to clear the graph area when analyser not required.
1 parent d2c5231 commit d804bf9

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ <h4>Log sync</h4>
234234
<h2>Legend <span class="log-close-legend-dialog glyphicon glyphicon-remove"></span></h2>
235235
<div class="log-graph-legend">
236236
</div>
237+
<button type="button" class="btn btn-default btn-block hide-analyser-window">Hide Analyser</button>
237238
<button type="button" class="btn btn-default btn-block open-graph-configuration-dialog">Graph setup</button>
238239
</div>
239240
</div>

js/graph_legend.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,31 @@ function GraphLegend(targetElem, config, onVisibilityChange, onNewSelectionChang
3939
config.selectedFieldName = this.innerText;
4040
config.selectedGraphIndex = $(this).attr('graph');
4141
config.selectedFieldIndex = $(this).attr('field');
42+
$('.hide-analyser-window').show();
4243
if (onNewSelectionChange) {
4344
onNewSelectionChange();
4445
}
4546
});
4647

48+
// Add a button to remove the analyser display
49+
$('.hide-analyser-window').on('click', function() {
50+
config.selectedFieldName = null;
51+
$(this).hide();
52+
if (onNewSelectionChange) {
53+
onNewSelectionChange();
54+
}
55+
});
56+
4757
$('.log-close-legend-dialog').on('click', function() {
4858
that.hide();
4959
});
5060

5161
$('.log-open-legend-dialog').on('click', function() {
5262
that.show();
5363
});
64+
65+
// on first show, hide the analyser button
66+
if(!config.selectedFieldName) $('.hide-analyser-window').hide();
5467
}
5568

5669
this.show = function() {

0 commit comments

Comments
 (0)