Commit 16884fdf authored by Pavel Reznikov's avatar Pavel Reznikov
Browse files

fix grid initialization

parent 1ed21714
......@@ -310,6 +310,7 @@ Changes
#### v0.2.2 (current development version)
- fix grid initialization
- add `cell_height`/`cell_width` API methods
- fix boolean attributes (issue #31)
......
......@@ -352,8 +352,16 @@
}, this.opts.float, this.opts.height);
if (this.opts.auto) {
var elements = [];
this.container.find('.' + this.opts.item_class).each(function (index, el) {
self._prepare_element(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'))
});
});
_.chain(elements).sortBy(function (x) { return x.i; }).each(function (i) {
self._prepare_element(i.el);
});
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment