From 86d957a8f5957080ca018511bdeb04f4d841b9d7 Mon Sep 17 00:00:00 2001 From: Pavel Reznikov Date: Thu, 14 May 2015 20:29:52 -0700 Subject: [PATCH] update gridstack --- gridstack.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gridstack.js b/gridstack.js index 88f9604..4587c48 100644 --- a/gridstack.js +++ b/gridstack.js @@ -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) {