]> source.dussan.org Git - jquery-ui.git/commitdiff
Dialog: Remove width, min-height, height styles on destroy. Fixes #8119 - Dialog...
authorScott González <scott.gonzalez@gmail.com>
Tue, 4 Dec 2012 15:03:05 +0000 (10:03 -0500)
committerScott González <scott.gonzalez@gmail.com>
Tue, 4 Dec 2012 15:03:05 +0000 (10:03 -0500)
tests/unit/dialog/dialog_methods.js
tests/unit/testsuite.js
ui/jquery.ui.dialog.js

index e5275c7a4fef4a6b1463a577eaa98da43a241710..6eeb50273e5274c678035c2ddafb606f6ff4f4a7 100644 (file)
@@ -35,6 +35,11 @@ test("init", function() {
 
 test("destroy", function() {
        expect( 6 );
+
+       // Dialogs are expected to be hidden on destroy, so make sure they're hidden
+       // before the test
+       $( "#dialog1, #form-dialog" ).hide();
+
        domEqual( "#dialog1", function() {
                var dialog = $( "#dialog1" ).dialog().dialog( "destroy" );
                equal( dialog.parent()[ 0 ], $( "#qunit-fixture" )[ 0 ] );
index 18337fe4eae57b3c5ac941cf70d861047b07778d..42fdf4f9e6ca80397e3fd21063b312e5806ae583 100644 (file)
@@ -212,7 +212,7 @@ window.domEqual = function( selector, modifier, message ) {
                        "tabIndex",
                        "title"
                ];
-/*
+
        function getElementStyles( elem ) {
                var key, len,
                        style = elem.ownerDocument.defaultView ?
@@ -239,7 +239,7 @@ window.domEqual = function( selector, modifier, message ) {
 
                return styles;
        }
-*/
+
        function extract( elem ) {
                if ( !elem || !elem.length ) {
                        QUnit.push( false, actual, expected,
@@ -257,8 +257,7 @@ window.domEqual = function( selector, modifier, message ) {
                        var value = elem.attr( attr );
                        result[ attr ] = value !== undefined ? value : "";
                });
-               // TODO: Enable when we can figure out what's happening with accordion
-               //result.style = getElementStyles( elem[ 0 ] );
+               result.style = getElementStyles( elem[ 0 ] );
                result.events = $._data( elem[ 0 ], "events" );
                result.data = $.extend( {}, elem.data() );
                delete result.data[ $.expando ];
index 361beeb4cc18671b27b7e47ed14c4b4b9d05337f..96c9986567eb66139e983c80ecc4a64bfe692512 100644 (file)
@@ -127,6 +127,11 @@ $.widget("ui.dialog", {
                this.element
                        .removeUniqueId()
                        .removeClass( "ui-dialog-content ui-widget-content" )
+                       .css({
+                               width: "",
+                               minHeight: "",
+                               height: ""
+                       })
                        .hide()
                        // without detaching first, the following becomes really slow
                        .detach();