Skip to content

Commit 279da3e

Browse files
author
Alain Dumesny
committed
revert onStartMoving()
1 parent 47adbf1 commit 279da3e

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/gridstack.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1278,9 +1278,8 @@
12781278
self.grid.cleanNodes();
12791279
self.grid.beginUpdate(node);
12801280
cellWidth = self.cellWidth();
1281-
height = o.attr('data-gs-height');
1282-
verticalMargin = self.opts.verticalMargin;
1283-
cellHeight = Math.ceil((o.outerHeight() - (height - 1) * verticalMargin) / height);
1281+
var strictCellHeight = Math.ceil(o.outerHeight() / o.attr('data-gs-height'));
1282+
cellHeight = self.container.height() / parseInt(self.container.attr('data-gs-current-height'));
12841283
self.placeholder
12851284
.attr('data-gs-x', o.attr('data-gs-x'))
12861285
.attr('data-gs-y', o.attr('data-gs-y'))
@@ -1291,9 +1290,9 @@
12911290
node._beforeDragX = node.x;
12921291
node._beforeDragY = node.y;
12931292
node._prevYPix = ui.position.top;
1294-
minHeight = (node.minHeight || 1);
1293+
12951294
self.dd.resizable(el, 'option', 'minWidth', cellWidth * (node.minWidth || 1));
1296-
self.dd.resizable(el, 'option', 'minHeight', cellHeight * minHeight + (minHeight - 1) * verticalMargin);
1295+
self.dd.resizable(el, 'option', 'minHeight', strictCellHeight * (node.minHeight || 1));
12971296

12981297
if (event.type == 'resizestart') {
12991298
o.find('.grid-stack-item').trigger('resizestart');

0 commit comments

Comments
 (0)