diff --git a/gridstack.js b/gridstack.js index 60af6ee..28890e4 100644 --- a/gridstack.js +++ b/gridstack.js @@ -169,7 +169,8 @@ placeholder_class: 'grid-stack-placeholder', handle: '.grid-stack-item-content', cell_height: 60, - vertical_margin: 20 + vertical_margin: 20, + auto: true }); this.grid = new GridStackEngine(this.opts.width, function (nodes) { @@ -182,9 +183,11 @@ }); }); - this.container.find('.' + this.opts.item_class).each(function (index, el) { - self._prepare_element(el); - }); + if (this.opts.auto) { + this.container.find('.' + this.opts.item_class).each(function (index, el) { + self._prepare_element(el); + }); + } this.placeholder = $('
').hide(); this.container.append(this.placeholder);