Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0f6ab48 commit e24192bCopy full SHA for e24192b
gridstack.js
@@ -352,8 +352,16 @@
352
}, this.opts.float, this.opts.height);
353
354
if (this.opts.auto) {
355
+ var elements = [];
356
this.container.find('.' + this.opts.item_class).each(function (index, el) {
- self._prepare_element(el);
357
+ el = $(el);
358
+ elements.push({
359
+ el: el,
360
+ i: parseInt(el.attr('data-gs-x')) + parseInt(el.attr('data-gs-y')) * parseInt(el.attr('data-gs-width'))
361
+ });
362
363
+ _.chain(elements).sortBy(function (x) { return x.i; }).each(function (i) {
364
+ self._prepare_element(i.el);
365
});
366
}
367
0 commit comments