r2069 - in trunk: tests/unit/resizable tests/visual/resizable ui

r2069 - in trunk: tests/unit/resizable tests/visual/resizable ui


Author: scott.gonzalez
Date: Thu Feb 12 19:36:56 2009
New Revision: 2069
Removed:
trunk/tests/visual/resizable/resizable_option_preventDefault_false.html
trunk/tests/visual/resizable/resizable_option_preventDefault_true.html
Modified:
trunk/tests/unit/resizable/resizable_defaults.js
trunk/ui/ui.resizable.js
Log:
Resizable:
- Fixed destroy method.
- Removed preventDefault option (Fixed #4135 - preventDefault should not
be an option as there's not use case for false).
Modified: trunk/tests/unit/resizable/resizable_defaults.js
==============================================================================
--- trunk/tests/unit/resizable/resizable_defaults.js    (original)
+++ trunk/tests/unit/resizable/resizable_defaults.js    Thu Feb 12 19:36:56
2009
@@ -22,7 +22,6 @@
    maxWidth: null,
    minHeight: 10,
    minWidth: 10,
-    preventDefault: true,
    zIndex: 1000
};
Modified: trunk/ui/ui.resizable.js
==============================================================================
--- trunk/ui/ui.resizable.js    (original)
+++ trunk/ui/ui.resizable.js    Thu Feb 12 19:36:56 2009
@@ -57,7 +57,8 @@
            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 @@
        //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 @@
        maxWidth: null,
        minHeight: 10,
        minWidth: 10,
-        preventDefault: true,
        zIndex: 1000
    }
});