From fc00d8336f2be39aa6af712cd19030ed68b006bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Mon, 9 Dec 2019 10:49:35 +0100 Subject: [PATCH] Alerting: Improve alert threshold handle dragging behavior (#20922) --- public/app/plugins/panel/graph/threshold_manager.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/public/app/plugins/panel/graph/threshold_manager.ts b/public/app/plugins/panel/graph/threshold_manager.ts index 6ffc899f549..a988a0336d3 100644 --- a/public/app/plugins/panel/graph/threshold_manager.ts +++ b/public/app/plugins/panel/graph/threshold_manager.ts @@ -60,8 +60,7 @@ export class ThresholdManager { model.value = graphValue; handleElem.off('mousemove', dragging); - handleElem.off('mouseup', dragging); - handleElem.off('mouseleave', dragging); + document.removeEventListener('mouseup', stopped); // trigger digest and render panelCtrl.$scope.$apply(() => { @@ -77,8 +76,7 @@ export class ThresholdManager { posTop = handleElem.position().top; handleElem.on('mousemove', dragging); - handleElem.on('mouseup', stopped); - handleElem.on('mouseleave', stopped); + document.addEventListener('mouseup', stopped); } cleanUp() {