Ignore:
Timestamp:
Jun 24, 2014, 10:16:59 PM (10 years ago)
Author:
rvelices
Message:

upgrade jquery ui from 1.10.1 to 1.10.4

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/themes/default/js/ui/jquery.ui.dialog.js

    r20824 r28780  
    11/*!
    2  * jQuery UI Dialog 1.10.1
     2 * jQuery UI Dialog 1.10.4
    33 * http://jqueryui.com
    44 *
    5  * Copyright 2013 jQuery Foundation and other contributors
     5 * Copyright 2014 jQuery Foundation and other contributors
    66 * Released under the MIT license.
    77 * http://jquery.org/license
     
    3737
    3838$.widget( "ui.dialog", {
    39         version: "1.10.1",
     39        version: "1.10.4",
    4040        options: {
    4141                appendTo: "body",
     
    170170
    171171        close: function( event ) {
    172                 var that = this;
     172                var activeElement,
     173                        that = this;
    173174
    174175                if ( !this._isOpen || this._trigger( "beforeClose", event ) === false ) {
     
    180181
    181182                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 ) {}
    186199                }
    187200
     
    343356                });
    344357
    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>" )
    346362                        .button({
    347363                                label: this.options.closeText,
     
    557573
    558574        _setOption: function( key, value ) {
    559                 /*jshint maxcomplexity:15*/
    560575                var isDraggable, isResizable,
    561576                        uiDialog = this.uiDialog;
     
    693708        },
    694709
     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
    695720        _createOverlay: function() {
    696721                if ( !this.options.modal ) {
     
    698723                }
    699724
     725                var that = this,
     726                        widgetFullName = this.widgetFullName;
    700727                if ( !$.ui.dialog.overlayInstances ) {
    701728                        // Prevent use of anchors and inputs.
     
    706733                                if ( $.ui.dialog.overlayInstances ) {
    707734                                        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 ) ) {
    712736                                                        event.preventDefault();
    713737                                                        $(".ui-dialog:visible:last .ui-dialog-content")
    714                                                                 .data("ui-dialog")._focusTabbable();
     738                                                                .data( widgetFullName )._focusTabbable();
    715739                                                }
    716740                                        });
Note: See TracChangeset for help on using the changeset viewer.