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

Skip to content

Commit 37ee988

Browse files
committed
add auto option
1 parent 3199fad commit 37ee988

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

gridstack.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,8 @@
169169
placeholder_class: 'grid-stack-placeholder',
170170
handle: '.grid-stack-item-content',
171171
cell_height: 60,
172-
vertical_margin: 20
172+
vertical_margin: 20,
173+
auto: true
173174
});
174175

175176
this.grid = new GridStackEngine(this.opts.width, function (nodes) {
@@ -182,9 +183,11 @@
182183
});
183184
});
184185

185-
this.container.find('.' + this.opts.item_class).each(function (index, el) {
186-
self._prepare_element(el);
187-
});
186+
if (this.opts.auto) {
187+
this.container.find('.' + this.opts.item_class).each(function (index, el) {
188+
self._prepare_element(el);
189+
});
190+
}
188191

189192
this.placeholder = $('<div class="' + this.opts.placeholder_class + ' ' + this.opts.item_class + '"><div class="placeholder-content" /></div>').hide();
190193
this.container.append(this.placeholder);

0 commit comments

Comments
 (0)