From e5d8c7bb398b2bb92eb49886b4a87a9adebe4d97 Mon Sep 17 00:00:00 2001 From: Tom Cleven Date: Thu, 2 Jun 2016 14:13:45 +0200 Subject: [PATCH] Fixes grid height not updated when added new item using cellHeight = 'auto' --- src/gridstack.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gridstack.js b/src/gridstack.js index bbf077a..38aa435 100644 --- a/src/gridstack.js +++ b/src/gridstack.js @@ -1488,8 +1488,8 @@ }; GridStack.prototype.cellWidth = function() { - var o = this.container.children('.' + this.opts.itemClass).first(); - return Math.ceil(o.outerWidth() / parseInt(o.attr('data-gs-width'), 10)); + var o = $(this.container); + return Math.ceil(o.outerWidth() / o.attr('data-gs-width')); }; GridStack.prototype.getCellFromPixel = function(position, useOffset) {