diff options
author | Chi Cheng <cloudream@gmail.com> | 2008-08-10 07:58:50 +0000 |
---|---|---|
committer | Chi Cheng <cloudream@gmail.com> | 2008-08-10 07:58:50 +0000 |
commit | eec36c91aa4290bd197922794fa5585b09dfc4a2 (patch) | |
tree | a0bb6e2ab2762ee642aa5a7c7f1251a6b8b3d121 /ui/ui.draggable.js | |
parent | c400d7d68ddd1a8e05b3e6298a760fcfac55a79b (diff) | |
download | jquery-ui-eec36c91aa4290bd197922794fa5585b09dfc4a2.tar.gz jquery-ui-eec36c91aa4290bd197922794fa5585b09dfc4a2.zip |
draggable: fix snapTolerance option instead of default
Diffstat (limited to 'ui/ui.draggable.js')
-rw-r--r-- | ui/ui.draggable.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/ui/ui.draggable.js b/ui/ui.draggable.js index accacbcaa..8c9059b08 100644 --- a/ui/ui.draggable.js +++ b/ui/ui.draggable.js @@ -431,10 +431,10 @@ $.ui.plugin.add("draggable", "snap", { } if(ui.options.snapMode != 'inner') { - var ts = Math.abs(t - y2) <= 20; - var bs = Math.abs(b - y1) <= 20; - var ls = Math.abs(l - x2) <= 20; - var rs = Math.abs(r - x1) <= 20; + var ts = Math.abs(t - y2) <= d; + var bs = Math.abs(b - y1) <= d; + var ls = Math.abs(l - x2) <= d; + var rs = Math.abs(r - x1) <= d; if(ts) ui.position.top = inst.convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top; if(bs) ui.position.top = inst.convertPositionTo("relative", { top: b, left: 0 }).top; if(ls) ui.position.left = inst.convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left; @@ -444,10 +444,10 @@ $.ui.plugin.add("draggable", "snap", { var first = (ts || bs || ls || rs); if(ui.options.snapMode != 'outer') { - var ts = Math.abs(t - y1) <= 20; - var bs = Math.abs(b - y2) <= 20; - var ls = Math.abs(l - x1) <= 20; - var rs = Math.abs(r - x2) <= 20; + var ts = Math.abs(t - y1) <= d; + var bs = Math.abs(b - y2) <= d; + var ls = Math.abs(l - x1) <= d; + var rs = Math.abs(r - x2) <= d; if(ts) ui.position.top = inst.convertPositionTo("relative", { top: t, left: 0 }).top; if(bs) ui.position.top = inst.convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top; if(ls) ui.position.left = inst.convertPositionTo("relative", { top: 0, left: l }).left; |