fix ‘w’ resize

This commit is contained in:
Pavel Reznikov 2015-05-14 20:28:47 -07:00
commit 2e0dbc1e6a
4 changed files with 10 additions and 3 deletions

6
dist/gridstack.js vendored
View file

@ -429,11 +429,12 @@
if (this.opts.auto) {
var elements = [];
var _this = this;
this.container.children('.' + this.opts.item_class).each(function (index, el) {
el = $(el);
elements.push({
el: el,
i: parseInt(el.attr('data-gs-x')) + parseInt(el.attr('data-gs-y')) * parseInt(el.attr('data-gs-width'))
i: parseInt(el.attr('data-gs-x')) + parseInt(el.attr('data-gs-y')) * _this.opts.width // Use opts.width as weight for Y
});
});
_.chain(elements).sortBy(function (x) { return x.i; }).each(function (i) {
@ -590,6 +591,9 @@
.attr('data-gs-height', o.attr('data-gs-height'))
.show();
node.el = self.placeholder;
el.resizable('option', 'minWidth', cell_width * (node.min_width || 1));
el.resizable('option', 'minHeight', self.opts.cell_height * (node.min_height || 1));
};
var on_end_moving = function (event, ui) {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -591,6 +591,9 @@
.attr('data-gs-height', o.attr('data-gs-height'))
.show();
node.el = self.placeholder;
el.resizable('option', 'minWidth', cell_width * (node.min_width || 1));
el.resizable('option', 'minHeight', self.opts.cell_height * (node.min_height || 1));
};
var on_end_moving = function (event, ui) {