fix #460: fix cellWidth method
This commit is contained in:
parent
b09ae61fe2
commit
11b6292d31
5
dist/gridstack.js
vendored
5
dist/gridstack.js
vendored
|
@ -1043,7 +1043,7 @@
|
|||
var o = $(this);
|
||||
self.grid.cleanNodes();
|
||||
self.grid.beginUpdate(node);
|
||||
cellWidth = Math.ceil(o.outerWidth() / o.attr('data-gs-width'));
|
||||
cellWidth = self.cellWidth();
|
||||
var strictCellHeight = Math.ceil(o.outerHeight() / o.attr('data-gs-height'));
|
||||
cellHeight = self.container.height() / parseInt(self.container.attr('data-gs-current-height'));
|
||||
self.placeholder
|
||||
|
@ -1494,8 +1494,7 @@
|
|||
};
|
||||
|
||||
GridStack.prototype.cellWidth = function() {
|
||||
var o = this.container.children('.' + this.opts.itemClass).first();
|
||||
return Math.ceil(o.outerWidth() / parseInt(o.attr('data-gs-width'), 10));
|
||||
return Math.round(this.container.outerWidth() / this.opts.width);
|
||||
};
|
||||
|
||||
GridStack.prototype.getCellFromPixel = function(position, useOffset) {
|
||||
|
|
14
dist/gridstack.min.js
vendored
14
dist/gridstack.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/gridstack.min.map
vendored
2
dist/gridstack.min.map
vendored
File diff suppressed because one or more lines are too long
|
@ -1043,7 +1043,7 @@
|
|||
var o = $(this);
|
||||
self.grid.cleanNodes();
|
||||
self.grid.beginUpdate(node);
|
||||
cellWidth = Math.ceil(o.outerWidth() / o.attr('data-gs-width'));
|
||||
cellWidth = self.cellWidth();
|
||||
var strictCellHeight = Math.ceil(o.outerHeight() / o.attr('data-gs-height'));
|
||||
cellHeight = self.container.height() / parseInt(self.container.attr('data-gs-current-height'));
|
||||
self.placeholder
|
||||
|
@ -1494,8 +1494,7 @@
|
|||
};
|
||||
|
||||
GridStack.prototype.cellWidth = function() {
|
||||
var o = this.container.children('.' + this.opts.itemClass).first();
|
||||
return Math.ceil(o.outerWidth() / parseInt(o.attr('data-gs-width'), 10));
|
||||
return Math.round(this.container.outerWidth() / this.opts.width);
|
||||
};
|
||||
|
||||
GridStack.prototype.getCellFromPixel = function(position, useOffset) {
|
||||
|
|
Loading…
Reference in a new issue