Skip to content

Commit

Permalink
Merge pull request #221 from McGiverGim/fix_scroll_mac
Browse files Browse the repository at this point in the history
Fix scroll legend under Mac OS
  • Loading branch information
mikeller committed Jul 8, 2018
2 parents 0ed0410 + b2a6fae commit 85cd0f3
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 14 deletions.
16 changes: 9 additions & 7 deletions index.html
Expand Up @@ -468,12 +468,12 @@ <h4>Log sync</h4>
<canvas width="0" height="0" id="stickCanvas"></canvas>
<span class="log-open-legend-dialog glyphicon glyphicon-cog" data-toggle="tooltip" title="Show the legend"></span>
</div>
<div class="log-graph-config no-wheel">
<h2 class="no-wheel">Legend
<span class="log-close-legend-dialog glyphicon glyphicon-remove no-wheel" data-toggle="tooltip" title="Hide the legend"></span>
<div class="log-graph-config">
<h2>Legend
<span class="log-close-legend-dialog glyphicon glyphicon-remove" data-toggle="tooltip" title="Hide the legend"></span>
</h2>
<div class="log-index no-wheel"></div>
<div class="log-graph-legend no-wheel">
<div class="log-index"></div>
<div class="log-graph-legend">
</div>

<div class="btn-group override-button-group" role="group">
Expand All @@ -500,7 +500,7 @@ <h2 class="no-wheel">Legend
</button>
</div>

<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>
<button type="button" class="btn btn-default btn-block open-graph-configuration-dialog" data-toggle="tooltip" title="Setup chart pens">Graph setup</button>
</div>
<div class="mouseNotification"></div>
</div>
Expand Down Expand Up @@ -1865,7 +1865,9 @@ <h4 class="modal-title">Shortcut Keys</h4>
<ul>
<li>
<span class="keys">
<div><img src="./images/glyphs/scrollwheel.svg" data-toggle="tooltip" title="Mouse Scroll Wheel" /></div>
<div class="key">Ctrl</div>
<div class="normal">+</div>
<img src="./images/glyphs/scrollwheel.svg" data-toggle="tooltip" title="Mouse Scroll Wheel" />
</span>
<div class="description">Adjust Smoothing of field in graph by hovering field in legend and scroll</div>
</li>
Expand Down
6 changes: 3 additions & 3 deletions js/graph_legend.js
Expand Up @@ -14,12 +14,12 @@ function GraphLegend(targetElem, config, onVisibilityChange, onNewSelectionChang
for (i = 0; i < graphs.length; i++) {
var
graph = graphs[i],
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>'),
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>'),
graphTitle = $("h3", graphDiv),
fieldList = $("ul", graphDiv);

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

for (j = 0; j < graph.fields.length; j++) {
var
Expand All @@ -28,7 +28,7 @@ function GraphLegend(targetElem, config, onVisibilityChange, onNewSelectionChang
nameElem = $('<span class="graph-legend-field-name field-quick-adjust" name="' + field.name + '" graph="' + i + '" field="' + j +'"></span>'),
valueElem = $('<span class="graph-legend-field-value field-quick-adjust" name="' + field.name + '" graph="' + i + '" field="' + j +'"></span>'),
settingsElem = $('<div class="graph-legend-field-settings field-quick-adjust" name="' + field.name + '" graph="' + i + '" field="' + j +'"></div>'),
analyseElem = $('<span class="glyphicon glyphicon-equalizer no-wheel"></span>');
analyseElem = $('<span class="glyphicon glyphicon-equalizer"></span>');
li.append(nameElem);
li.append(analyseElem);
li.append(valueElem);
Expand Down
11 changes: 7 additions & 4 deletions js/main.js
Expand Up @@ -1636,20 +1636,23 @@ function BlackboxLogViewer() {
if($(e.target).hasClass('field-quick-adjust')) {
var refreshRequired = false;

if(e.shiftKey) { // change zoom
if (e.shiftKey) { // change zoom
refreshRequired = changePenZoom(activeGraphConfig.getGraphs(), $(e.target).attr('graph'), $(e.target).attr('field'), (delta>=0))
} else if(e.altKey) { // change Expo
e.preventDefault();
} else if (e.altKey) { // change Expo
refreshRequired = changePenExpo(activeGraphConfig.getGraphs(), $(e.target).attr('graph'), $(e.target).attr('field'), (delta>=0))
} else { // Change smoothing
e.preventDefault();
} else if (e.ctrlKey){ // Change smoothing
refreshRequired = changePenSmoothing(activeGraphConfig.getGraphs(), $(e.target).attr('graph'), $(e.target).attr('field'), (delta>=0))
e.preventDefault();
}

if(refreshRequired) {
graph.refreshGraphConfig();
invalidateGraph();
mouseNotification.show($('.log-graph'), null, null, refreshRequired, 750, null, 'bottom-right', 0);
}
e.preventDefault();

return true;
}
}
Expand Down

0 comments on commit 85cd0f3

Please sign in to comment.