Skip to content
Permalink
Browse files

Dialog: Use event delegation to cancel events for modal dialogs. Fixe…

…s #2807 - dialogUI + modal mode = slow.
  • Loading branch information...
scottgonzalez committed Feb 19, 2009
1 parent 06a513b commit 835cbf1833fa1893cfcae10cb44b170f89ea4178
Showing with 2 additions and 2 deletions.
  1. +2 −2 ui/ui.dialog.js
@@ -524,7 +524,7 @@ $.extend($.ui.dialog.overlay, {
// we use a setTimeout in case the overlay is created from an
// event that we're going to be cancelling (see #2804)
setTimeout(function() {
$('a, :input').bind($.ui.dialog.overlay.events, function() {
$(document).bind($.ui.dialog.overlay.events, function() {
// allow use of the element if inside a dialog and
// - there are no modal dialogs
// - there are modal dialogs, but we are in front of the topmost modal
@@ -572,7 +572,7 @@ $.extend($.ui.dialog.overlay, {
this.instances.splice($.inArray(this.instances, $el), 1);

if (this.instances.length === 0) {
$('a, :input').add([document, window]).unbind('.dialog-overlay');
$([document, window]).unbind('.dialog-overlay');
}

$el.remove();

0 comments on commit 835cbf1

Please sign in to comment.
You can’t perform that action at this time.