aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.dialog.js
diff options
context:
space:
mode:
authorFelix Nagel <info@felixnagel.com>2013-03-03 13:48:01 +0100
committerFelix Nagel <info@felixnagel.com>2013-03-03 13:48:01 +0100
commitdffe8f66109714af2d4ed8f582af4cf3439433e3 (patch)
treed83889fc566946bd35e4f8dc866f2aac5e4b095a /ui/jquery.ui.dialog.js
parentd94e217065745e9ad0638cf68d3d973ffe44035a (diff)
parent6d3a1e1fe8cc21f385456ea26075f3909136a589 (diff)
downloadjquery-ui-dffe8f66109714af2d4ed8f582af4cf3439433e3.tar.gz
jquery-ui-dffe8f66109714af2d4ed8f582af4cf3439433e3.zip
Merge branch 'master' into selectmenu
Diffstat (limited to 'ui/jquery.ui.dialog.js')
-rw-r--r--ui/jquery.ui.dialog.js19
1 files changed, 14 insertions, 5 deletions
diff --git a/ui/jquery.ui.dialog.js b/ui/jquery.ui.dialog.js
index 85dbddda2..b35c0ffcf 100644
--- a/ui/jquery.ui.dialog.js
+++ b/ui/jquery.ui.dialog.js
@@ -692,11 +692,23 @@ $.widget( "ui.dialog", {
}
},
+ _allowInteraction: function( event ) {
+ if ( $( event.target ).closest(".ui-dialog").length ) {
+ return true;
+ }
+
+ // TODO: Remove hack when datepicker implements
+ // the .ui-front logic (#8989)
+ return !!$( event.target ).closest(".ui-datepicker").length;
+ },
+
_createOverlay: function() {
if ( !this.options.modal ) {
return;
}
+ var that = this,
+ widgetFullName = this.widgetFullName;
if ( !$.ui.dialog.overlayInstances ) {
// Prevent use of anchors and inputs.
// We use a delay in case the overlay is created from an
@@ -705,13 +717,10 @@ $.widget( "ui.dialog", {
// Handle .dialog().dialog("close") (#4065)
if ( $.ui.dialog.overlayInstances ) {
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 ) {
+ if ( !that._allowInteraction( event ) ) {
event.preventDefault();
$(".ui-dialog:visible:last .ui-dialog-content")
- .data("ui-dialog")._focusTabbable();
+ .data( widgetFullName )._focusTabbable();
}
});
}