Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Draggable: Check for grid elements set to 0 to prevent divide by 0 error causing invalid argument errors in IE. Fixed #6950 - ie 8 invalid drag and drop error #268

Merged
merged 1 commit into from

2 participants

Kris Borchers Scott González
Kris Borchers
Owner

Draggable: Check for grid elements set to 0 to prevent divide by 0 error causing invalid argument errors in IE. Fixed #6950 - ie 8 invalid drag and drop error

Kris Borchers kborchers Draggable: Check for grid elements set to 0 to prevent divide by 0 er…
…ror causing invalid argument errors in IE. Fixed #6950 - ie 8 invalid drag and drop error
d136e43
Scott González scottgonzalez merged commit aec3f18 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 13, 2011
  1. Kris Borchers

    Draggable: Check for grid elements set to 0 to prevent divide by 0 er…

    kborchers authored
    …ror causing invalid argument errors in IE. Fixed #6950 - ie 8 invalid drag and drop error
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 2 deletions.
  1. +3 −2 ui/jquery.ui.draggable.js
5 ui/jquery.ui.draggable.js
View
@@ -436,10 +436,11 @@ $.widget("ui.draggable", $.ui.mouse, {
}
if(o.grid) {
- var top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1];
+ //Check for grid elements set to 0 to prevent divide by 0 error causing invalid argument errors in IE (see ticket #6950)
+ var top = o.grid[1] ? this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1] : this.originalPageY;
pageY = containment ? (!(top - this.offset.click.top < containment[1] || top - this.offset.click.top > containment[3]) ? top : (!(top - this.offset.click.top < containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;
- var left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0];
+ var left = o.grid[0] ? this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0] : this.originalPageX;
pageX = containment ? (!(left - this.offset.click.left < containment[0] || left - this.offset.click.left > containment[2]) ? left : (!(left - this.offset.click.left < containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
}
Something went wrong with that request. Please try again.