]> source.dussan.org Git - jquery-ui.git/commitdiff
Resizable:
authorScott González <scott.gonzalez@gmail.com>
Fri, 13 Feb 2009 03:36:56 +0000 (03:36 +0000)
committerScott González <scott.gonzalez@gmail.com>
Fri, 13 Feb 2009 03:36:56 +0000 (03:36 +0000)
  - Fixed destroy method.
  - Removed preventDefault option (Fixed #4135 - preventDefault should not be an option as there's not use case for false).

tests/unit/resizable/resizable_defaults.js
tests/visual/resizable/resizable_option_preventDefault_false.html [deleted file]
tests/visual/resizable/resizable_option_preventDefault_true.html [deleted file]
ui/ui.resizable.js

index 52513924d014c02cbc0930de60b7031fd06e709a..f69e5217cb970c413e7ab1122da660dca192058f 100644 (file)
@@ -22,7 +22,6 @@ var resizable_defaults = {
        maxWidth: null,
        minHeight: 10,
        minWidth: 10,
-       preventDefault: true,
        zIndex: 1000
 };
 
diff --git a/tests/visual/resizable/resizable_option_preventDefault_false.html b/tests/visual/resizable/resizable_option_preventDefault_false.html
deleted file mode 100644 (file)
index 5d22f6b..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-<!doctype html>
-<html lang="en">
-<head>
-       <title>Resizable Visual Test : Resizable option preventDefault false</title>
-       <link rel="stylesheet" href="../visual.css" type="text/css" />
-       <link rel="stylesheet" href="../../../themes/base/ui.all.css" type="text/css" />
-       <script type="text/javascript" src="../../../jquery-1.3.1.js"></script>
-       <script type="text/javascript" src="../../../ui/ui.core.js"></script>
-       <script type="text/javascript" src="../../../ui/ui.resizable.js"></script>
-       <script type="text/javascript">
-       $(function() {
-               $("#resizable").resizable({
-                       preventDefault: false
-               });
-       });
-       </script>
-</head>
-<body>
-
-<textarea id="resizable">Resizable</texarea>
-
-</body>
-</html>
diff --git a/tests/visual/resizable/resizable_option_preventDefault_true.html b/tests/visual/resizable/resizable_option_preventDefault_true.html
deleted file mode 100644 (file)
index 0d153b6..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-<!doctype html>
-<html lang="en">
-<head>
-       <title>Resizable Visual Test : Resizable option preventDefault true</title>
-       <link rel="stylesheet" href="../visual.css" type="text/css" />
-       <link rel="stylesheet" href="../../../themes/base/ui.all.css" type="text/css" />
-       <script type="text/javascript" src="../../../jquery-1.3.1.js"></script>
-       <script type="text/javascript" src="../../../ui/ui.core.js"></script>
-       <script type="text/javascript" src="../../../ui/ui.resizable.js"></script>
-       <script type="text/javascript">
-       $(function() {
-               $("#resizable").resizable({
-                       preventDefault: true
-               });
-       });
-       </script>
-</head>
-<body>
-
-<textarea id="resizable">Resizable</texarea>
-
-</body>
-</html>
index a0503c456ddba29e28dea4706f555d5f295dacd4..bea9b4de165ac1b2e7de53366ca31e73b20c4588 100644 (file)
@@ -57,7 +57,8 @@ $.widget("ui.resizable", $.extend({}, $.ui.mouse, {
                        this.originalElement.css({ marginLeft: 0, marginTop: 0, marginRight: 0, marginBottom: 0});
 
                        //Prevent Safari textarea resize
-                       if ($.browser.safari && o.preventDefault) this.originalElement.css('resize', 'none');
+                       this.originalResizeStyle = this.originalElement.css('resize');
+                       this.originalElement.css('resize', 'none');
 
                        //Push the actual element to our proportionallyResize internal array
                        this._proportionallyResizeElements.push(this.originalElement.css({ position: 'static', zoom: 1, display: 'block' }));
@@ -183,17 +184,19 @@ $.widget("ui.resizable", $.extend({}, $.ui.mouse, {
                //TODO: Unwrap at same DOM position
                if (this.elementIsWrapper) {
                        _destroy(this.element);
-                       this.wrapper.parent().append(
+                       var wrapper = this.element;
+                       wrapper.parent().append(
                                this.originalElement.css({
-                                       position: this.wrapper.css('position'),
-                                       width: this.wrapper.outerWidth(),
-                                       height: this.wrapper.outerHeight(),
-                                       top: this.wrapper.css('top'),
-                                       left: this.wrapper.css('left')
+                                       position: wrapper.css('position'),
+                                       width: wrapper.outerWidth(),
+                                       height: wrapper.outerHeight(),
+                                       top: wrapper.css('top'),
+                                       left: wrapper.css('left')
                                })
                        ).end().remove();
                }
 
+               this.originalElement.css('resize', this.originalResizeStyle);
                _destroy(this.originalElement);
 
        },
@@ -514,7 +517,6 @@ $.extend($.ui.resizable, {
                maxWidth: null,
                minHeight: 10,
                minWidth: 10,
-               preventDefault: true,
                zIndex: 1000
        }
 });