aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.resizable.js
diff options
context:
space:
mode:
authorKris Borchers <kris.borchers@gmail.com>2013-11-08 22:45:36 -0600
committerScott González <scott.gonzalez@gmail.com>2014-01-15 04:37:32 -0500
commit20c1648f68660b267eec302d43a7b1014cda6e1a (patch)
tree8f22bf5c458d182543996a7983bddfb7db3d9616 /ui/jquery.ui.resizable.js
parent7741c9f678088a129c1782f4e7f061bc12a41279 (diff)
downloadjquery-ui-20c1648f68660b267eec302d43a7b1014cda6e1a.tar.gz
jquery-ui-20c1648f68660b267eec302d43a7b1014cda6e1a.zip
Resizable: Only resize/reposition if size is greater than specified grid
Fixes #9611 Closes gh-1132
Diffstat (limited to 'ui/jquery.ui.resizable.js')
-rw-r--r--ui/jquery.ui.resizable.js18
1 files changed, 14 insertions, 4 deletions
diff --git a/ui/jquery.ui.resizable.js b/ui/jquery.ui.resizable.js
index 3470e88eb..636cf4123 100644
--- a/ui/jquery.ui.resizable.js
+++ b/ui/jquery.ui.resizable.js
@@ -1002,10 +1002,20 @@ $.ui.plugin.add("resizable", "grid", {
that.size.height = newHeight;
that.position.left = op.left - ox;
} else {
- that.size.width = newWidth;
- that.size.height = newHeight;
- that.position.top = op.top - oy;
- that.position.left = op.left - ox;
+ if ( newHeight - gridY > 0 ) {
+ that.size.height = newHeight;
+ that.position.top = op.top - oy;
+ } else {
+ that.size.height = gridY;
+ that.position.top = op.top + os.height - gridY;
+ }
+ if ( newWidth - gridX > 0 ) {
+ that.size.width = newWidth;
+ that.position.left = op.left - ox;
+ } else {
+ that.size.width = gridX;
+ that.position.left = op.left + os.width - gridX;
+ }
}
}