Skip to content

Commit 85cd0f3

Browse files
authored
Merge pull request #221 from McGiverGim/fix_scroll_mac
Fix scroll legend under Mac OS
2 parents 0ed0410 + b2a6fae commit 85cd0f3

File tree

3 files changed

+19
-14
lines changed

3 files changed

+19
-14
lines changed

index.html

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -468,12 +468,12 @@ <h4>Log sync</h4>
468468
<canvas width="0" height="0" id="stickCanvas"></canvas>
469469
<span class="log-open-legend-dialog glyphicon glyphicon-cog" data-toggle="tooltip" title="Show the legend"></span>
470470
</div>
471-
<div class="log-graph-config no-wheel">
472-
<h2 class="no-wheel">Legend
473-
<span class="log-close-legend-dialog glyphicon glyphicon-remove no-wheel" data-toggle="tooltip" title="Hide the legend"></span>
471+
<div class="log-graph-config">
472+
<h2>Legend
473+
<span class="log-close-legend-dialog glyphicon glyphicon-remove" data-toggle="tooltip" title="Hide the legend"></span>
474474
</h2>
475-
<div class="log-index no-wheel"></div>
476-
<div class="log-graph-legend no-wheel">
475+
<div class="log-index"></div>
476+
<div class="log-graph-legend">
477477
</div>
478478

479479
<div class="btn-group override-button-group" role="group">
@@ -500,7 +500,7 @@ <h2 class="no-wheel">Legend
500500
</button>
501501
</div>
502502

503-
<button type="button" class="btn btn-default btn-block open-graph-configuration-dialog no-wheel" data-toggle="tooltip" title="Setup chart pens">Graph setup</button>
503+
<button type="button" class="btn btn-default btn-block open-graph-configuration-dialog" data-toggle="tooltip" title="Setup chart pens">Graph setup</button>
504504
</div>
505505
<div class="mouseNotification"></div>
506506
</div>
@@ -1865,7 +1865,9 @@ <h4 class="modal-title">Shortcut Keys</h4>
18651865
<ul>
18661866
<li>
18671867
<span class="keys">
1868-
<div><img src="./images/glyphs/scrollwheel.svg" data-toggle="tooltip" title="Mouse Scroll Wheel" /></div>
1868+
<div class="key">Ctrl</div>
1869+
<div class="normal">+</div>
1870+
<img src="./images/glyphs/scrollwheel.svg" data-toggle="tooltip" title="Mouse Scroll Wheel" />
18691871
</span>
18701872
<div class="description">Adjust Smoothing of field in graph by hovering field in legend and scroll</div>
18711873
</li>

js/graph_legend.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ function GraphLegend(targetElem, config, onVisibilityChange, onNewSelectionChang
1414
for (i = 0; i < graphs.length; i++) {
1515
var
1616
graph = graphs[i],
17-
graphDiv = $('<div class="graph-legend no-wheel" id="' + i +'"><h3 class="graph-legend-group field-quick-adjust" graph="' + i + '"></h3><ul class="list-unstyled graph-legend-field-list no-wheel"></ul></div>'),
17+
graphDiv = $('<div class="graph-legend" id="' + i +'"><h3 class="graph-legend-group field-quick-adjust" graph="' + i + '"></h3><ul class="list-unstyled graph-legend-field-list"></ul></div>'),
1818
graphTitle = $("h3", graphDiv),
1919
fieldList = $("ul", graphDiv);
2020

2121
graphTitle.text(graph.label);
22-
graphTitle.prepend('<span class="glyphicon glyphicon-minus no-wheel"></span>');
22+
graphTitle.prepend('<span class="glyphicon glyphicon-minus"></span>');
2323

2424
for (j = 0; j < graph.fields.length; j++) {
2525
var
@@ -28,7 +28,7 @@ function GraphLegend(targetElem, config, onVisibilityChange, onNewSelectionChang
2828
nameElem = $('<span class="graph-legend-field-name field-quick-adjust" name="' + field.name + '" graph="' + i + '" field="' + j +'"></span>'),
2929
valueElem = $('<span class="graph-legend-field-value field-quick-adjust" name="' + field.name + '" graph="' + i + '" field="' + j +'"></span>'),
3030
settingsElem = $('<div class="graph-legend-field-settings field-quick-adjust" name="' + field.name + '" graph="' + i + '" field="' + j +'"></div>'),
31-
analyseElem = $('<span class="glyphicon glyphicon-equalizer no-wheel"></span>');
31+
analyseElem = $('<span class="glyphicon glyphicon-equalizer"></span>');
3232
li.append(nameElem);
3333
li.append(analyseElem);
3434
li.append(valueElem);

js/main.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1636,20 +1636,23 @@ function BlackboxLogViewer() {
16361636
if($(e.target).hasClass('field-quick-adjust')) {
16371637
var refreshRequired = false;
16381638

1639-
if(e.shiftKey) { // change zoom
1639+
if (e.shiftKey) { // change zoom
16401640
refreshRequired = changePenZoom(activeGraphConfig.getGraphs(), $(e.target).attr('graph'), $(e.target).attr('field'), (delta>=0))
1641-
} else if(e.altKey) { // change Expo
1641+
e.preventDefault();
1642+
} else if (e.altKey) { // change Expo
16421643
refreshRequired = changePenExpo(activeGraphConfig.getGraphs(), $(e.target).attr('graph'), $(e.target).attr('field'), (delta>=0))
1643-
} else { // Change smoothing
1644+
e.preventDefault();
1645+
} else if (e.ctrlKey){ // Change smoothing
16441646
refreshRequired = changePenSmoothing(activeGraphConfig.getGraphs(), $(e.target).attr('graph'), $(e.target).attr('field'), (delta>=0))
1647+
e.preventDefault();
16451648
}
16461649

16471650
if(refreshRequired) {
16481651
graph.refreshGraphConfig();
16491652
invalidateGraph();
16501653
mouseNotification.show($('.log-graph'), null, null, refreshRequired, 750, null, 'bottom-right', 0);
16511654
}
1652-
e.preventDefault();
1655+
16531656
return true;
16541657
}
16551658
}

0 commit comments

Comments
 (0)