#237 Add optional useOffset parameter to getCellFromPixel.
This commit is contained in:
parent
1039368121
commit
78803147c6
6 changed files with 13 additions and 9 deletions
|
|
@ -1300,8 +1300,9 @@
|
|||
return Math.ceil(o.outerWidth() / o.attr('data-gs-width'));
|
||||
};
|
||||
|
||||
GridStack.prototype.getCellFromPixel = function(position) {
|
||||
var containerPos = this.container.position();
|
||||
GridStack.prototype.getCellFromPixel = function(position, useOffset) {
|
||||
var containerPos = (typeof useOffset != 'undefined' && useOffset) ?
|
||||
this.container.offset() : this.container.position();
|
||||
var relativeLeft = position.left - containerPos.left;
|
||||
var relativeTop = position.top - containerPos.top;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue