mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
graph(add annotation): refactor
pass ctrlKey and metaKey through flot events
This commit is contained in:
4
public/vendor/flot/jquery.flot.js
vendored
4
public/vendor/flot/jquery.flot.js
vendored
@@ -2972,6 +2972,10 @@ Licensed under the MIT license.
|
||||
pos.pageX = event.pageX;
|
||||
pos.pageY = event.pageY;
|
||||
|
||||
// Add ctrlKey and metaKey to event
|
||||
pos.ctrlKey = event.ctrlKey;
|
||||
pos.metaKey = event.metaKey;
|
||||
|
||||
var item = findNearbyItem(canvasX, canvasY, seriesFilter);
|
||||
|
||||
if (item) {
|
||||
|
||||
8
public/vendor/flot/jquery.flot.selection.js
vendored
8
public/vendor/flot/jquery.flot.selection.js
vendored
@@ -145,7 +145,7 @@ The plugin allso adds the following methods to the plot object:
|
||||
updateSelection(e);
|
||||
|
||||
if (selectionIsSane())
|
||||
triggerSelectedEvent();
|
||||
triggerSelectedEvent(e);
|
||||
else {
|
||||
// this counts as a clear
|
||||
plot.getPlaceholder().trigger("plotunselected", [ ]);
|
||||
@@ -180,9 +180,13 @@ The plugin allso adds the following methods to the plot object:
|
||||
return r;
|
||||
}
|
||||
|
||||
function triggerSelectedEvent() {
|
||||
function triggerSelectedEvent(event) {
|
||||
var r = getSelection();
|
||||
|
||||
// Add ctrlKey and metaKey to event
|
||||
r.ctrlKey = event.ctrlKey;
|
||||
r.metaKey = event.metaKey;
|
||||
|
||||
plot.getPlaceholder().trigger("plotselected", [ r ]);
|
||||
|
||||
// backwards-compat stuff, to be removed in future
|
||||
|
||||
Reference in New Issue
Block a user