Added parseInt(x, 10) to cellWidth and added some unit tests.

This commit is contained in:
d 2016-02-25 15:48:25 -05:00
commit b9c916554e
5 changed files with 318 additions and 5 deletions

View file

@ -1360,7 +1360,7 @@
GridStack.prototype.cellWidth = function() {
var o = this.container.children('.' + this.opts.itemClass).first();
return Math.ceil(o.outerWidth() / o.attr('data-gs-width'));
return Math.ceil(o.outerWidth() / parseInt(o.attr('data-gs-width'), 10));
};
GridStack.prototype.getCellFromPixel = function(position, useOffset) {