aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.dialog.js
diff options
context:
space:
mode:
authorJörn Zaefferer <joern.zaefferer@gmail.com>2012-11-26 10:08:34 +0100
committerJörn Zaefferer <joern.zaefferer@gmail.com>2012-11-26 10:28:25 +0100
commit60486ac632a0a1bbbb0c7449fe17bccfae11af80 (patch)
treef2b1781f459364097be0181086abfcdaf935c3ea /ui/jquery.ui.dialog.js
parentd179cbaf3233ace0bc542e836c5c46e4129a9e0a (diff)
downloadjquery-ui-60486ac632a0a1bbbb0c7449fe17bccfae11af80.tar.gz
jquery-ui-60486ac632a0a1bbbb0c7449fe17bccfae11af80.zip
Dialog: Don't focus dialog when mousedown is on close button. Fixes #8838 - Dialog: Close icon does not work in dialog larger than the window in IE.
Diffstat (limited to 'ui/jquery.ui.dialog.js')
-rw-r--r--ui/jquery.ui.dialog.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/ui/jquery.ui.dialog.js b/ui/jquery.ui.dialog.js
index bcfc6f07c..5eb3e2aca 100644
--- a/ui/jquery.ui.dialog.js
+++ b/ui/jquery.ui.dialog.js
@@ -321,9 +321,14 @@ $.widget("ui.dialog", {
.addClass( "ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix" )
.prependTo( this.uiDialog );
this._on( this.uiDialogTitlebar, {
- mousedown: function() {
- // Dialog isn't getting focus when dragging (#8063)
- this.uiDialog.focus();
+ mousedown: function( event ) {
+ // Don't prevent click on close button (#8838)
+ // Focusing a dialog that is partially scrolled out of view
+ // causes the browser to scroll it into view, preventing the click event
+ if ( !$( event.target ).closest( ".ui-dialog-titlebar-close" ) ) {
+ // Dialog isn't getting focus when dragging (#8063)
+ this.uiDialog.focus();
+ }
}
});