From a652b89e82b458ccf8e5a4efbd7f69efdda69756 Mon Sep 17 00:00:00 2001 From: Pavel Reznikov Date: Mon, 1 Dec 2014 18:12:24 -0800 Subject: [PATCH] update gridstack.js --- gridstack.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gridstack.js b/gridstack.js index 90ac8a7..38e7264 100644 --- a/gridstack.js +++ b/gridstack.js @@ -395,7 +395,7 @@ }); el.data('_gridstack_node', node); - var cell_width, cell_height = this.opts.cell_height + this.opts.vertical_margin / 2; + var cell_width, cell_height = this.opts.cell_height + this.opts.vertical_margin; var on_start_moving = function (event, ui) { var o = $(this); @@ -442,7 +442,7 @@ stop: on_end_moving, drag: function (event, ui) { var x = Math.round(ui.position.left / cell_width), - y = Math.floor(ui.position.top / cell_height); + y = Math.floor((ui.position.top + cell_height/2) / cell_height); if (self.opts.height && !self.grid.can_move_node(node, x, y, node.width, node.height)) { return; }