Module: check_mk
Branch: master
Commit: 52f3331fb2559ad93339eeb73eda633f40b95b7b
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=52f3331fb2559a…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Dec 22 13:41:35 2016 +0100
Fixed element dragging with different sized rows
Change-Id: I5f32b21680fa6f412fa980b78c822c405a91cbbd
---
web/htdocs/js/checkmk.js | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/web/htdocs/js/checkmk.js b/web/htdocs/js/checkmk.js
index 9de8f55..618439e 100644
--- a/web/htdocs/js/checkmk.js
+++ b/web/htdocs/js/checkmk.js
@@ -1755,8 +1755,7 @@ function element_dragging(event)
function position_dragging_object(event)
{
var dragging = g_dragging.dragging,
- container = dragging.parentNode,
- offset_y = Math.abs(mouse_offset_to_middle(dragging, event).y);
+ container = dragging.parentNode;
var get_previous = function(node) {
var previous = node.previousElementSibling;
@@ -1777,7 +1776,7 @@ function position_dragging_object(event)
// Move it up?
var previous = get_previous(dragging);
- while (previous && Math.abs(mouse_offset_to_middle(previous, event).y) <
offset_y) {
+ while (previous && mouse_offset_to_middle(previous, event).y < 0) {
g_dragging.moved = true;
container.insertBefore(dragging, previous);
previous = get_previous(dragging);
@@ -1785,7 +1784,7 @@ function position_dragging_object(event)
// Move it down?
var next = get_next(dragging);
- while (next && Math.abs(mouse_offset_to_middle(next, event).y) < offset_y)
{
+ while (next && mouse_offset_to_middle(next, event).y > 0) {
g_dragging.moved = true;
container.insertBefore(dragging, next.nextElementSibling);
next = get_next(dragging);