Skip to content

Commit ddee298

Browse files
Gary KeebleGary Keeble
authored andcommitted
Tweak Mousewheel
The scroll event was triggering during dialog boxes
1 parent b5a983b commit ddee298

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

js/main.js

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -813,23 +813,25 @@ function BlackboxLogViewer() {
813813
$(window).resize(updateCanvasSize);
814814

815815
$(document).on("mousewheel", function(e) {
816-
var delta = Math.max(-1, Math.min(1, (e.originalEvent.wheelDelta)));
817-
if(delta<0) { // scroll down (or left)
818-
if (e.altKey || e.shiftKey) {
819-
setGraphZoom(graphZoom - 10.0 - ((e.altKey)?15.0:0.0));
820-
$(".graph-zoom").val(graphZoom + "%");
821-
} else {
822-
logJumpBack();
823-
}
824-
} else { // scroll up or right
825-
if (e.altKey || e.shiftKey) {
826-
setGraphZoom(graphZoom + 10.0 + ((e.altKey)?15.0:0.0));
827-
$(".graph-zoom").val(graphZoom + "%");
828-
} else {
829-
logJumpForward();
816+
if (graph && $(e.target).parents('.modal').length == 0) {
817+
var delta = Math.max(-1, Math.min(1, (e.originalEvent.wheelDelta)));
818+
if(delta<0) { // scroll down (or left)
819+
if (e.altKey || e.shiftKey) {
820+
setGraphZoom(graphZoom - 10.0 - ((e.altKey)?15.0:0.0));
821+
$(".graph-zoom").val(graphZoom + "%");
822+
} else {
823+
logJumpBack();
824+
}
825+
} else { // scroll up or right
826+
if (e.altKey || e.shiftKey) {
827+
setGraphZoom(graphZoom + 10.0 + ((e.altKey)?15.0:0.0));
828+
$(".graph-zoom").val(graphZoom + "%");
829+
} else {
830+
logJumpForward();
831+
}
830832
}
833+
e.preventDefault();
831834
}
832-
e.preventDefault();
833835
});
834836

835837
$(document).keydown(function(e) {

0 commit comments

Comments
 (0)