]> source.dussan.org Git - jquery-ui.git/commitdiff
Dialog: Cleanup style properties on _destroy. Reenables style check in domEqual,...
authorJörn Zaefferer <joern.zaefferer@gmail.com>
Mon, 3 Dec 2012 23:35:33 +0000 (00:35 +0100)
committerJörn Zaefferer <joern.zaefferer@gmail.com>
Mon, 3 Dec 2012 23:35:47 +0000 (00:35 +0100)
tests/unit/dialog/dialog_methods.js
tests/unit/testsuite.js
ui/jquery.ui.dialog.js

index e5275c7a4fef4a6b1463a577eaa98da43a241710..3753144f3cb6b024997b36857efd3d42250bfe69 100644 (file)
@@ -35,6 +35,8 @@ test("init", function() {
 
 test("destroy", function() {
        expect( 6 );
+       // expect dialogs to be hidden before and after
+       $( "#dialog1, #form-dialog" ).hide();
        domEqual( "#dialog1", function() {
                var dialog = $( "#dialog1" ).dialog().dialog( "destroy" );
                equal( dialog.parent()[ 0 ], $( "#qunit-fixture" )[ 0 ] );
index 18337fe4eae57b3c5ac941cf70d861047b07778d..808e6c6eaa2848403df068741724d93023be9f91 100644 (file)
@@ -210,36 +210,10 @@ window.domEqual = function( selector, modifier, message ) {
                        "nodeName",
                        "role",
                        "tabIndex",
-                       "title"
+                       "title",
+                       "style"
                ];
-/*
-       function getElementStyles( elem ) {
-               var key, len,
-                       style = elem.ownerDocument.defaultView ?
-                               elem.ownerDocument.defaultView.getComputedStyle( elem, null ) :
-                               elem.currentStyle,
-                       styles = {};
-
-               if ( style && style.length && style[ 0 ] && style[ style[ 0 ] ] ) {
-                       len = style.length;
-                       while ( len-- ) {
-                               key = style[ len ];
-                               if ( typeof style[ key ] === "string" ) {
-                                       styles[ $.camelCase( key ) ] = style[ key ];
-                               }
-                       }
-               // support: Opera, IE <9
-               } else {
-                       for ( key in style ) {
-                               if ( typeof style[ key ] === "string" ) {
-                                       styles[ key ] = style[ key ];
-                               }
-                       }
-               }
 
-               return styles;
-       }
-*/
        function extract( elem ) {
                if ( !elem || !elem.length ) {
                        QUnit.push( false, actual, expected,
@@ -257,8 +231,6 @@ 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.events = $._data( elem[ 0 ], "events" );
                result.data = $.extend( {}, elem.data() );
                delete result.data[ $.expando ];
index 4a8b9964f46275786a653edaa776ac1c20525898..382008e0823ffbc5b45da485cb09ab7ee808727d 100644 (file)
@@ -127,6 +127,11 @@ $.widget("ui.dialog", {
                this.element
                        .removeUniqueId()
                        .removeClass( "ui-dialog-content ui-widget-content" )
+                       .css({
+                               "width": "",
+                               "min-height": "",
+                               "height": ""
+                       })
                        .hide()
                        // without detaching first, the following becomes really slow
                        .detach();