]> source.dussan.org Git - jquery-ui.git/commitdiff
Resizable: Update aspectRatio to use calculated aspectRatio in case of: containment...
authorgromo <yuriy@tokyoscale.com>
Wed, 22 Feb 2012 08:05:02 +0000 (13:05 +0500)
committerScott González <scott.gonzalez@gmail.com>
Fri, 2 Mar 2012 11:16:39 +0000 (06:16 -0500)
(cherry picked from commit 3e8ec7eb6bee97034363fe4e8704ed762fadbaba)

ui/jquery.ui.resizable.js

index 8eb72e2248571a2838e5768dc09bef96ecfcf312..c5ec79c1f55a2dc491d1e7e940a927f403f457fb 100644 (file)
@@ -691,13 +691,13 @@ $.ui.plugin.add("resizable", "containment", {
 
                if (cp.left < (self._helper ? co.left : 0)) {
                        self.size.width = self.size.width + (self._helper ? (self.position.left - co.left) : (self.position.left - cop.left));
-                       if (pRatio) self.size.height = self.size.width / o.aspectRatio;
+                       if (pRatio) self.size.height = self.size.width / self.aspectRatio;
                        self.position.left = o.helper ? co.left : 0;
                }
 
                if (cp.top < (self._helper ? co.top : 0)) {
                        self.size.height = self.size.height + (self._helper ? (self.position.top - co.top) : self.position.top);
-                       if (pRatio) self.size.width = self.size.height * o.aspectRatio;
+                       if (pRatio) self.size.width = self.size.height * self.aspectRatio;
                        self.position.top = self._helper ? co.top : 0;
                }