]> source.dussan.org Git - jquery-ui.git/commitdiff
Resizable grid bug on IE - fixed #2939
authorEduardo Lundgren <eduardolundgren@gmail.com>
Tue, 3 Jun 2008 20:00:50 +0000 (20:00 +0000)
committerEduardo Lundgren <eduardolundgren@gmail.com>
Tue, 3 Jun 2008 20:00:50 +0000 (20:00 +0000)
ui/source/ui.resizable.js

index 286f61d7fb82aa79e0f4ae85ce4e1725eaa7f410..2203f3945f6efdff79f7060da544c58340777b64 100644 (file)
@@ -582,7 +582,7 @@ $.ui.plugin.add("resizable", "grid", {
        resize: function(e, ui) {\r
                var o = ui.options, self = $(this).data("resizable"), cs = self.size, os = self.originalSize, op = self.originalPosition, a = self.axis, ratio = o._aspectRatio || e.shiftKey;\r
                o.grid = typeof o.grid == "number" ? [o.grid, o.grid] : o.grid;\r
-               var ox = Math.round((cs.width - os.width) / o.grid[0]) * o.grid[0], oy = Math.round((cs.height - os.height) / o.grid[1]) * o.grid[1];\r
+               var ox = Math.round((cs.width - os.width) / (o.grid[0]||1)) * (o.grid[0]||1), oy = Math.round((cs.height - os.height) / (o.grid[1]||1)) * (o.grid[1]||1);\r
                \r
                if (/^(se|s|e)$/.test(a)) {\r
                        self.size.width = os.width + ox;\r