Now use top and bottom of widget instead of just center height when calculating remove. Fixes the removal of widgets when top leaves grid
This commit is contained in:
parent
fcd2327194
commit
d57dff7db3
1 changed files with 3 additions and 1 deletions
|
|
@ -986,6 +986,8 @@
|
|||
var dragOrResize = function(event, ui) {
|
||||
var x = Math.round(ui.position.left / cellWidth);
|
||||
var y = Math.floor((ui.position.top + cellHeight / 2) / cellHeight);
|
||||
var yTop = Math.floor(ui.position.top / cellHeight);
|
||||
var yBottom = Math.floor((ui.position.top + cellHeight) / cellHeight);
|
||||
var width;
|
||||
var height;
|
||||
|
||||
|
|
@ -995,7 +997,7 @@
|
|||
}
|
||||
|
||||
if (event.type == 'drag') {
|
||||
if (x < 0 || x >= self.grid.width || y < 0) {
|
||||
if (x < 0 || x >= self.grid.width || yTop < 0 || yBottom > self.grid.height) {
|
||||
if (self.opts.removable === true) {
|
||||
self._setupRemovingTimeout(el);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue