Skip to main content

Bug Tracker

Side navigation

Ticket #1711: resizable_shiftkey.diff
File resizable_shiftkey.diff, 0.9 KB (added by c_t, September 22, 2007 08:35AM UTC)

Fixed shift-key behaviour of N, S, NE and NW handles

--- ui.resizable.js	(Revision 370)
+++ ui.resizable.js	(Arbeitskopie)
@@ -230,6 +230,9 @@
 						break;
 					case 's':
 						nw = p[0];
+						
+						if(e.shiftKey) nw = nh * (p[0]/p[1])
+						
 						break;
 					case 'n':
 					case 'ne':
@@ -241,6 +244,9 @@
 						if(o.axis == 'n') nw = p[0];
 						var mod = (this.pos[1] - co.top); nh = nh - (mod*2);
 						mod = nh <= o.minHeight ? p[1] - o.minHeight : (nh >= o.maxHeight ? 0-(o.maxHeight-p[1]) : mod);
+						
+						if(e.shiftKey) nw = nh * (p[0]/p[1])
+						
 						$(this.helper).css('top', co.top + mod);
 						break;
 						
@@ -266,7 +272,9 @@
 						
 						var mody = (this.pos[1] - co.top); nh = nh - (mody*2);
 						mody = nh <= o.minHeight ? p[1] - o.minHeight : (nh >= o.maxHeight ? 0-(o.maxHeight-p[1]) : mody);
-
+						
+						if(e.shiftKey) mody = modx * (p[1]/p[0]);
+						
 						$(this.helper).css({
 							left: co.left + modx,
 							top: co.top + mody

Download in other formats:

Original Format