Changeset 28780 for trunk/themes/default/js/ui/jquery.ui.dialog.js
- Timestamp:
- Jun 24, 2014, 10:16:59 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/themes/default/js/ui/jquery.ui.dialog.js
r20824 r28780 1 1 /*! 2 * jQuery UI Dialog 1.10. 12 * jQuery UI Dialog 1.10.4 3 3 * http://jqueryui.com 4 4 * 5 * Copyright 201 3jQuery Foundation and other contributors5 * Copyright 2014 jQuery Foundation and other contributors 6 6 * Released under the MIT license. 7 7 * http://jquery.org/license … … 37 37 38 38 $.widget( "ui.dialog", { 39 version: "1.10. 1",39 version: "1.10.4", 40 40 options: { 41 41 appendTo: "body", … … 170 170 171 171 close: function( event ) { 172 var that = this; 172 var activeElement, 173 that = this; 173 174 174 175 if ( !this._isOpen || this._trigger( "beforeClose", event ) === false ) { … … 180 181 181 182 if ( !this.opener.filter(":focusable").focus().length ) { 182 // Hiding a focused element doesn't trigger blur in WebKit 183 // so in case we have nothing to focus on, explicitly blur the active element 184 // https://bugs.webkit.org/show_bug.cgi?id=47182 185 $( this.document[0].activeElement ).blur(); 183 184 // support: IE9 185 // IE9 throws an "Unspecified error" accessing document.activeElement from an <iframe> 186 try { 187 activeElement = this.document[ 0 ].activeElement; 188 189 // Support: IE9, IE10 190 // If the <body> is blurred, IE will switch windows, see #4520 191 if ( activeElement && activeElement.nodeName.toLowerCase() !== "body" ) { 192 193 // Hiding a focused element doesn't trigger blur in WebKit 194 // so in case we have nothing to focus on, explicitly blur the active element 195 // https://bugs.webkit.org/show_bug.cgi?id=47182 196 $( activeElement ).blur(); 197 } 198 } catch ( error ) {} 186 199 } 187 200 … … 343 356 }); 344 357 345 this.uiDialogTitlebarClose = $("<button></button>") 358 // support: IE 359 // Use type="button" to prevent enter keypresses in textboxes from closing the 360 // dialog in IE (#9312) 361 this.uiDialogTitlebarClose = $( "<button type='button'></button>" ) 346 362 .button({ 347 363 label: this.options.closeText, … … 557 573 558 574 _setOption: function( key, value ) { 559 /*jshint maxcomplexity:15*/560 575 var isDraggable, isResizable, 561 576 uiDialog = this.uiDialog; … … 693 708 }, 694 709 710 _allowInteraction: function( event ) { 711 if ( $( event.target ).closest(".ui-dialog").length ) { 712 return true; 713 } 714 715 // TODO: Remove hack when datepicker implements 716 // the .ui-front logic (#8989) 717 return !!$( event.target ).closest(".ui-datepicker").length; 718 }, 719 695 720 _createOverlay: function() { 696 721 if ( !this.options.modal ) { … … 698 723 } 699 724 725 var that = this, 726 widgetFullName = this.widgetFullName; 700 727 if ( !$.ui.dialog.overlayInstances ) { 701 728 // Prevent use of anchors and inputs. … … 706 733 if ( $.ui.dialog.overlayInstances ) { 707 734 this.document.bind( "focusin.dialog", function( event ) { 708 if ( !$( event.target ).closest(".ui-dialog").length && 709 // TODO: Remove hack when datepicker implements 710 // the .ui-front logic (#8989) 711 !$( event.target ).closest(".ui-datepicker").length ) { 735 if ( !that._allowInteraction( event ) ) { 712 736 event.preventDefault(); 713 737 $(".ui-dialog:visible:last .ui-dialog-content") 714 .data( "ui-dialog")._focusTabbable();738 .data( widgetFullName )._focusTabbable(); 715 739 } 716 740 });
Note: See TracChangeset
for help on using the changeset viewer.