Skip to content

Commit 050e71b

Browse files
committed
Revert "Dialog: Cleanup style properties on _destroy. Reenables style check in domEqual, while removing commented and unnecessary old code. Fixes #8119 - Dialog: Destroying a dialog leaves style, scrollleft, and scrolltop leftovers."
This reverts commit d687a1b.
1 parent 8072099 commit 050e71b

File tree

3 files changed

+30
-9
lines changed

3 files changed

+30
-9
lines changed

tests/unit/dialog/dialog_methods.js

-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ test("init", function() {
3535

3636
test("destroy", function() {
3737
expect( 6 );
38-
// expect dialogs to be hidden before and after
39-
$( "#dialog1, #form-dialog" ).hide();
4038
domEqual( "#dialog1", function() {
4139
var dialog = $( "#dialog1" ).dialog().dialog( "destroy" );
4240
equal( dialog.parent()[ 0 ], $( "#qunit-fixture" )[ 0 ] );

tests/unit/testsuite.js

+30-2
Original file line numberDiff line numberDiff line change
@@ -210,10 +210,36 @@ window.domEqual = function( selector, modifier, message ) {
210210
"nodeName",
211211
"role",
212212
"tabIndex",
213-
"title",
214-
"style"
213+
"title"
215214
];
215+
/*
216+
function getElementStyles( elem ) {
217+
var key, len,
218+
style = elem.ownerDocument.defaultView ?
219+
elem.ownerDocument.defaultView.getComputedStyle( elem, null ) :
220+
elem.currentStyle,
221+
styles = {};
222+
223+
if ( style && style.length && style[ 0 ] && style[ style[ 0 ] ] ) {
224+
len = style.length;
225+
while ( len-- ) {
226+
key = style[ len ];
227+
if ( typeof style[ key ] === "string" ) {
228+
styles[ $.camelCase( key ) ] = style[ key ];
229+
}
230+
}
231+
// support: Opera, IE <9
232+
} else {
233+
for ( key in style ) {
234+
if ( typeof style[ key ] === "string" ) {
235+
styles[ key ] = style[ key ];
236+
}
237+
}
238+
}
216239
240+
return styles;
241+
}
242+
*/
217243
function extract( elem ) {
218244
if ( !elem || !elem.length ) {
219245
QUnit.push( false, actual, expected,
@@ -231,6 +257,8 @@ window.domEqual = function( selector, modifier, message ) {
231257
var value = elem.attr( attr );
232258
result[ attr ] = value !== undefined ? value : "";
233259
});
260+
// TODO: Enable when we can figure out what's happening with accordion
261+
//result.style = getElementStyles( elem[ 0 ] );
234262
result.events = $._data( elem[ 0 ], "events" );
235263
result.data = $.extend( {}, elem.data() );
236264
delete result.data[ $.expando ];

ui/jquery.ui.dialog.js

-5
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,6 @@ $.widget("ui.dialog", {
127127
this.element
128128
.removeUniqueId()
129129
.removeClass( "ui-dialog-content ui-widget-content" )
130-
.css({
131-
"width": "",
132-
"min-height": "",
133-
"height": ""
134-
})
135130
.hide()
136131
// without detaching first, the following becomes really slow
137132
.detach();

0 commit comments

Comments
 (0)