Merge pull request #310 from crazydrecksack/master

[BUGFIX] offset problems for dragging and scaling with a lot of columns
This commit is contained in:
Pavel Reznikov 2016-02-08 22:32:43 -08:00
commit 83ac5af45f
2 changed files with 4 additions and 4 deletions

4
dist/gridstack.js vendored
View file

@ -635,7 +635,7 @@
var o = $(this);
self.grid.clean_nodes();
self.grid.begin_update(node);
cell_width = Math.ceil(o.outerWidth() / o.attr('data-gs-width'));
cell_width = o.outerWidth() / o.attr('data-gs-width');
cell_height = self.opts.cell_height + self.opts.vertical_margin;
self.placeholder
.attr('data-gs-x', o.attr('data-gs-x'))
@ -645,7 +645,7 @@
.show();
node.el = self.placeholder;
el.resizable('option', 'minWidth', cell_width * (node.min_width || 1));
el.resizable('option', 'minWidth', Math.round(cell_width * (node.min_width || 1)));
el.resizable('option', 'minHeight', self.opts.cell_height * (node.min_height || 1));
};

View file

@ -640,7 +640,7 @@
var o = $(this);
self.grid.clean_nodes();
self.grid.begin_update(node);
cell_width = Math.ceil(o.outerWidth() / o.attr('data-gs-width'));
cell_width = o.outerWidth() / o.attr('data-gs-width');
cell_height = self.opts.cell_height + self.opts.vertical_margin;
self.placeholder
.attr('data-gs-x', o.attr('data-gs-x'))
@ -650,7 +650,7 @@
.show();
node.el = self.placeholder;
el.resizable('option', 'minWidth', cell_width * (node.min_width || 1));
el.resizable('option', 'minWidth', Math.round(cell_width * (node.min_width || 1)));
el.resizable('option', 'minHeight', self.opts.cell_height * (node.min_height || 1));
};