Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 86d957a

Browse files
committed
update gridstack
1 parent 7efabdf commit 86d957a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

gridstack.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,11 +429,12 @@
429429

430430
if (this.opts.auto) {
431431
var elements = [];
432+
var _this = this;
432433
this.container.children('.' + this.opts.item_class).each(function (index, el) {
433434
el = $(el);
434435
elements.push({
435436
el: el,
436-
i: parseInt(el.attr('data-gs-x')) + parseInt(el.attr('data-gs-y')) * parseInt(el.attr('data-gs-width'))
437+
i: parseInt(el.attr('data-gs-x')) + parseInt(el.attr('data-gs-y')) * _this.opts.width // Use opts.width as weight for Y
437438
});
438439
});
439440
_.chain(elements).sortBy(function (x) { return x.i; }).each(function (i) {
@@ -590,6 +591,9 @@
590591
.attr('data-gs-height', o.attr('data-gs-height'))
591592
.show();
592593
node.el = self.placeholder;
594+
595+
el.resizable('option', 'minWidth', cell_width * (node.min_width || 1));
596+
el.resizable('option', 'minHeight', self.opts.cell_height * (node.min_height || 1));
593597
};
594598

595599
var on_end_moving = function (event, ui) {

0 commit comments

Comments
 (0)