views:

367

answers:

7

I have dialog created like this

$('#add_error').click(function(e) {
        $('<div>')
            .load('/someaction/format/html/')
            .dialog({
                title: 'Some title',
                modal: true,
                width: 385,
                close: function() {
                     $(this).remove();
                }
            });

        e.preventDefault();
    });

It works ok, but every third (not really sure if its really third) time I click link to open dialog, it fails with error in firebug

"$("").addClass("ui-widget-overlay") is undefined"

In dialog.js that is piece of code:

var $el = (this.oldInstances.length ? this.oldInstances.splice(0, 1)[0] : $('<div></div>').addClass('ui-widget-overlay'))
                .appendTo(document.body)
                .css({
                    width: this.width(),
                    height: this.height()
                });

under create: function(dialog) method.

Strange thing is that this error does not occur when I remove

close: function() {
                     $(this).remove();
                }

Any idea?

A: 

Got the same behavior with same version!

Gal
A: 

I think it got to be connected to the: ui-widget-overlay in some strange way.

I just override it in my page like this: .ui-dialog-titlebar { display: none; } .ui-widget-overlay { background: #888888; opacity:.15;filter:Alpha(Opacity=15); }

and the reason to override ui-widget-overlay is just because the following doesn't work .ui-dialog-overlay { background: #888888; opacity:.15;filter:Alpha(Opacity=15); }

Gal
Still same error.
umpirsky
A: 

I also have the same issue.

Andrew
Maybe we should post a bug.
umpirsky
A: 

This has been fixed in trunk since 1.8rc3. See http://dev.jqueryui.com/ticket/5263

rdworth
A: 

http://dev.jqueryui.com/ticket/5263 http://forum.jquery.com/topic/ui-widget-overlay-css-selector-causes-consistent-large-memory-leak-in-ie#14737000000749340

umpirsky
A: 

@rdworth: Hi, I still have the same issue, even with latest build of jQueryUI. Regards,

Renaud.

Renaud
A: 

Everithing works with jQuery UI 1.8

umpirsky