Skip to main content

Search and Top Navigation

#5797 closed bug (worksforme)

Opened July 06, 2010 02:12AM UTC

Closed July 06, 2010 12:38PM UTC

Last modified October 11, 2012 09:15PM UTC

callback to $('.ui-dialog).fadeOut() gets triggered twice

Reported by: jf Owned by:
Priority: minor Milestone:
Component: ui.dialog Version: 1.8.2
Keywords: dialog fadeout callback twice Cc:
Blocked by: Blocking:
Description

This issue bugged me for a long time before I figured out that this was happening. To see clearly what's happening, try the following code once you have a dialog open:

$('.ui-dialog').fadeOut(1000, function() {

alert('fadeout callback');

});

You'll see that the callback gets called twice. Once immediately when the fadeout starts, and then the second time when the *real* callback ought to happen (ie., after the fadeout).

There is a workaround for this (but this is still a bug/surprise):

$('.ui-dialog').delay(1000, 'FF').queue('FF', function() {

alert('fadeout callback');

}).dequeue('FF');

Attachments (0)
Change History (4)

Changed July 06, 2010 12:38PM UTC by scottgonzalez comment:1

resolution: → worksforme
status: newclosed

This is working properly. You probably have two dialogs on the page, one is already hidden and is visible.

Changed July 06, 2010 12:39PM UTC by scottgonzalez comment:2

Replying to [comment:1 scott.gonzalez]:

This is working properly. You probably have two dialogs on the page, one is already hidden and is visible.

"...and *one* is visible"

Changed July 07, 2010 01:30AM UTC by jf comment:3

Replying to [comment:2 scott.gonzalez]:

Replying to [comment:1 scott.gonzalez]: > This is working properly. You probably have two dialogs on the page, one is already hidden and is visible. "...and *one* is visible"

wow, you're right!! thanks. I can't believe i didnt catch that... One question though - why does the workaround work in this case?

Changed October 11, 2012 09:15PM UTC by scottgonzalez comment:4

milestone: TBD

Milestone TBD deleted