aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.dialog.js
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2013-02-02 19:32:42 -0500
committerScott González <scott.gonzalez@gmail.com>2013-02-02 19:32:42 -0500
commit8724092e5070125e2610e8b0e6ee9ada126cf504 (patch)
tree62eeb38c62b8c8d2b8a6affca77d786a5c3fbab4 /ui/jquery.ui.dialog.js
parent9c6b8f859ae3ad3f956c6f9264da13fb44b3484d (diff)
downloadjquery-ui-8724092e5070125e2610e8b0e6ee9ada126cf504.tar.gz
jquery-ui-8724092e5070125e2610e8b0e6ee9ada126cf504.zip
Dialog: Don't use ._on() for modal event handlers. Fixes #9048 - Dialog: broken focusin event handler when beforeclose event of a modal opens another modal.
Diffstat (limited to 'ui/jquery.ui.dialog.js')
-rw-r--r--ui/jquery.ui.dialog.js20
1 files changed, 9 insertions, 11 deletions
diff --git a/ui/jquery.ui.dialog.js b/ui/jquery.ui.dialog.js
index cb62155e5..f2bc906fd 100644
--- a/ui/jquery.ui.dialog.js
+++ b/ui/jquery.ui.dialog.js
@@ -678,16 +678,14 @@ $.widget( "ui.dialog", {
this._delay(function() {
// Handle .dialog().dialog("close") (#4065)
if ( $.ui.dialog.overlayInstances ) {
- this._on( this.document, {
- focusin: function( event ) {
- if ( !$( event.target ).closest(".ui-dialog").length &&
- // TODO: Remove hack when datepicker implements
- // the .ui-front logic (#8989)
- !$( event.target ).closest(".ui-datepicker").length ) {
- event.preventDefault();
- $(".ui-dialog:visible:last .ui-dialog-content")
- .data("ui-dialog")._focusTabbable();
- }
+ this.document.bind( "focusin.dialog", function( event ) {
+ if ( !$( event.target ).closest(".ui-dialog").length &&
+ // TODO: Remove hack when datepicker implements
+ // the .ui-front logic (#8989)
+ !$( event.target ).closest(".ui-datepicker").length ) {
+ event.preventDefault();
+ $(".ui-dialog:visible:last .ui-dialog-content")
+ .data("ui-dialog")._focusTabbable();
}
});
}
@@ -712,7 +710,7 @@ $.widget( "ui.dialog", {
$.ui.dialog.overlayInstances--;
if ( !$.ui.dialog.overlayInstances ) {
- this._off( this.document, "focusin" );
+ this.document.unbind( "focusin.dialog" );
}
this.overlay.remove();
this.overlay = null;