From bd11b01aaa2a78d103b85b840b261a4952195fd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Thu, 26 Oct 2017 10:55:48 +0200 Subject: [PATCH] fix: firefox can now create region annotations, fixes #9638 (cherry picked from commit 0c2aa91e6135e33a27dc4192784b883a7f755577) --- public/vendor/flot/jquery.flot.js | 7 +++++-- public/vendor/flot/jquery.flot.selection.js | 5 +++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/public/vendor/flot/jquery.flot.js b/public/vendor/flot/jquery.flot.js index 41f5ea2fd2d..ec35fb87bd8 100644 --- a/public/vendor/flot/jquery.flot.js +++ b/public/vendor/flot/jquery.flot.js @@ -2962,8 +2962,11 @@ Licensed under the MIT license. } function onClick(e) { - triggerClickHoverEvent("plotclick", e, - function (s) { return s["clickable"] != false; }); + if (plot.isSelecting) { + return; + } + + triggerClickHoverEvent("plotclick", e, function (s) { return s["clickable"] != false; }); } // trigger click or hover event (they send the same parameters diff --git a/public/vendor/flot/jquery.flot.selection.js b/public/vendor/flot/jquery.flot.selection.js index 12e453c4c40..b34efd17775 100644 --- a/public/vendor/flot/jquery.flot.selection.js +++ b/public/vendor/flot/jquery.flot.selection.js @@ -152,6 +152,10 @@ The plugin allso adds the following methods to the plot object: plot.getPlaceholder().trigger("plotselecting", [ null ]); } + setTimeout(function() { + plot.isSelecting = false; + }, 10); + return false; } @@ -218,6 +222,7 @@ The plugin allso adds the following methods to the plot object: setSelectionPos(selection.second, pos); if (selectionIsSane()) { + plot.isSelecting = true; selection.show = true; plot.triggerRedrawOverlay(); }