]> source.dussan.org Git - jquery-ui.git/commitdiff
resizable: resizable doesn't expose ui.instance anymore
authorPaul Bakaus <paul.bakaus@googlemail.com>
Sun, 1 Jun 2008 14:22:24 +0000 (14:22 +0000)
committerPaul Bakaus <paul.bakaus@googlemail.com>
Sun, 1 Jun 2008 14:22:24 +0000 (14:22 +0000)
ui/source/ui.resizable.js

index b28ad809546ce797ec5c20930e1b70e75ddec385..e94cfee58d13fe3cf7416b04a48b17029d8ba327 100644 (file)
                plugins: {},\r
                ui: function() {\r
                        return {\r
-                               instance: this,\r
                                axis: this.options.axis,\r
                                options: this.options\r
                        };\r
        $.ui.plugin.add("resizable", "containment", {\r
                \r
                start: function(e, ui) {\r
-                       var o = ui.options, self = ui.instance, el = self.element;\r
+                       var o = ui.options, self = $(this).data("resizable"), el = self.element;\r
                        var oc = o.containment, ce = (oc instanceof $) ? oc.get(0) : (/parent/.test(oc)) ? el.parent().get(0) : oc;\r
                        if (!ce) return;\r
                        \r
                },\r
                \r
                resize: function(e, ui) {\r
-                       var o = ui.options, self = ui.instance, ps = self.containerSize, \r
+                       var o = ui.options, self = $(this).data("resizable"), ps = self.containerSize, \r
                                                co = self.containerOffset, cs = self.size, cp = self.position,\r
                                                        pRatio = o._aspectRatio || e.shiftKey;\r
                        \r
        $.ui.plugin.add("resizable", "grid", {\r
                \r
                resize: function(e, ui) {\r
-                       var o = ui.options, self = ui.instance, cs = self.size, os = self.originalSize, op = self.originalPosition, a = self.axis, ratio = o._aspectRatio || e.shiftKey;\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
                        \r
        $.ui.plugin.add("resizable", "animate", {\r
                \r
                stop: function(e, ui) {\r
-                       var o = ui.options, self = ui.instance;\r
+                       var o = ui.options, self = $(this).data("resizable");\r
                        \r
                        var pr = o.proportionallyResize, ista = pr && (/textarea/i).test(pr.get(0).nodeName), \r
                                                        soffseth = ista && $.ui.hasScroll(pr.get(0), 'left') /* TODO - jump height */ ? 0 : self.sizeDiff.height,\r
        $.ui.plugin.add("resizable", "ghost", {\r
                \r
                start: function(e, ui) {\r
-                       var o = ui.options, self = ui.instance, pr = o.proportionallyResize, cs = self.size;\r
+                       var o = ui.options, self = $(this).data("resizable"), pr = o.proportionallyResize, cs = self.size;\r
                        \r
                        if (!pr) self.ghost = self.element.clone();\r
                        else self.ghost = pr.clone();\r
                },\r
                \r
                resize: function(e, ui){\r
-                       var o = ui.options, self = ui.instance, pr = o.proportionallyResize;\r
+                       var o = ui.options, self = $(this).data("resizable"), pr = o.proportionallyResize;\r
                        \r
                        if (self.ghost) self.ghost.css({ position: 'relative', height: self.size.height, width: self.size.width });\r
                        \r
                },\r
                \r
                stop: function(e, ui){\r
-                       var o = ui.options, self = ui.instance, pr = o.proportionallyResize;\r
+                       var o = ui.options, self = $(this).data("resizable"), pr = o.proportionallyResize;\r
                        if (self.ghost && self.helper) self.helper.get(0).removeChild(self.ghost.get(0));\r
                }\r
                \r
        $.ui.plugin.add("resizable", "alsoResize", {\r
                \r
                start: function(e, ui) {\r
-                       var o = ui.options, self = ui.instance\r
+                       var o = ui.options, self = $(this).data("resizable")\r
                        \r
                        _store = function(exp) {\r
                                $(exp).each(function() {\r
                },\r
                \r
                resize: function(e, ui){\r
-                       var o = ui.options, self = ui.instance, os = self.originalSize, op = self.originalPosition;\r
+                       var o = ui.options, self = $(this).data("resizable"), os = self.originalSize, op = self.originalPosition;\r
                        \r
                        var delta = { \r
                                height: (self.size.height - os.height) || 0, width: (self.size.width - os.width) || 0,\r