diff options
author | Michał Gołębiowski-Owczarek <m.goleb@gmail.com> | 2021-04-09 23:36:00 +0200 |
---|---|---|
committer | Michał Gołębiowski-Owczarek <m.goleb@gmail.com> | 2024-05-15 00:38:30 +0200 |
commit | daa6fb55b35065c49c0ffc879c94627bbf85404c (patch) | |
tree | c1c90efc224aa82614758262b4e308cc8354ac65 /ui | |
parent | ac8b1e4eee8682e6825730c4823036a90031edad (diff) | |
download | jquery-ui-daa6fb55b35065c49c0ffc879c94627bbf85404c.tar.gz jquery-ui-daa6fb55b35065c49c0ffc879c94627bbf85404c.zip |
All: Drop support for jQueries different than the latest for each major
Also, remove the ability to run the test suite in jQuery <1.12.4 & <2.2.4.
Closes gh-2249
Diffstat (limited to 'ui')
-rw-r--r-- | ui/data.js | 16 | ||||
-rw-r--r-- | ui/effect.js | 9 | ||||
-rw-r--r-- | ui/jquery-patch.js | 12 | ||||
-rw-r--r-- | ui/widgets/datepicker.js | 8 | ||||
-rw-r--r-- | ui/widgets/dialog.js | 14 | ||||
-rw-r--r-- | ui/widgets/tabs.js | 23 |
6 files changed, 12 insertions, 70 deletions
diff --git a/ui/data.js b/ui/data.js index 5a1c650d4..e37461ac7 100644 --- a/ui/data.js +++ b/ui/data.js @@ -28,16 +28,10 @@ "use strict"; return $.extend( $.expr.pseudos, { - data: $.expr.createPseudo ? - $.expr.createPseudo( function( dataName ) { - return function( elem ) { - return !!$.data( elem, dataName ); - }; - } ) : - - // Support: jQuery <1.8 - function( elem, i, match ) { - return !!$.data( elem, match[ 3 ] ); - } + data: $.expr.createPseudo( function( dataName ) { + return function( elem ) { + return !!$.data( elem, dataName ); + }; + } ) } ); } ); diff --git a/ui/effect.js b/ui/effect.js index 2232e041d..ac9b0c809 100644 --- a/ui/effect.js +++ b/ui/effect.js @@ -125,15 +125,6 @@ function styleDifference( oldStyle, newStyle ) { return diff; } -// Support: jQuery <1.8 -if ( !$.fn.addBack ) { - $.fn.addBack = function( selector ) { - return this.add( selector == null ? - this.prevObject : this.prevObject.filter( selector ) - ); - }; -} - $.effects.animateClass = function( value, duration, easing, callback ) { var o = $.speed( duration, easing, callback ); diff --git a/ui/jquery-patch.js b/ui/jquery-patch.js index 07254d959..e03b32edf 100644 --- a/ui/jquery-patch.js +++ b/ui/jquery-patch.js @@ -27,18 +27,6 @@ } )( function( $ ) { "use strict"; -// Support: jQuery 1.9.x or older -// $.expr[ ":" ] is deprecated. -if ( !$.expr.pseudos ) { - $.expr.pseudos = $.expr[ ":" ]; -} - -// Support: jQuery 1.11.x or older -// $.unique has been renamed to $.uniqueSort -if ( !$.uniqueSort ) { - $.uniqueSort = $.unique; -} - // Support: jQuery 2.2.x or older. // This method has been defined in jQuery 3.0.0. // Code from https://github.com/jquery/jquery/blob/e539bac79e666bba95bba86d690b4e609dca2286/src/selector/escapeSelector.js diff --git a/ui/widgets/datepicker.js b/ui/widgets/datepicker.js index a271351e0..605760572 100644 --- a/ui/widgets/datepicker.js +++ b/ui/widgets/datepicker.js @@ -910,11 +910,8 @@ $.extend( Datepicker.prototype, { } }, - // #6694 - don't focus the input if it's already focused - // this breaks the change event in IE - // Support: IE and jQuery <1.9 _shouldFocusInput: function( inst ) { - return inst.input && inst.input.is( ":visible" ) && !inst.input.is( ":disabled" ) && !inst.input.is( ":focus" ); + return inst.input && inst.input.is( ":visible" ) && !inst.input.is( ":disabled" ); }, /* Check positioning to remain on screen. */ @@ -971,8 +968,7 @@ $.extend( Datepicker.prototype, { $.datepicker._tidyDialog( inst ); }; - // DEPRECATED: after BC for 1.8.x $.effects[ showAnim ] is not needed - if ( $.effects && ( $.effects.effect[ showAnim ] || $.effects[ showAnim ] ) ) { + if ( $.effects && ( $.effects.effect[ showAnim ] ) ) { inst.dpDiv.hide( showAnim, $.datepicker._get( inst, "showOptions" ), duration, postProcess ); } else { inst.dpDiv[ ( showAnim === "slideDown" ? "slideUp" : diff --git a/ui/widgets/dialog.js b/ui/widgets/dialog.js index e04598dcc..cbda81636 100644 --- a/ui/widgets/dialog.js +++ b/ui/widgets/dialog.js @@ -857,8 +857,6 @@ $.widget( "ui.dialog", { return; } - var jqMinor = $.fn.jquery.substring( 0, 4 ); - // We use a delay in case the overlay is created from an // event that we're going to be cancelling (#2804) var isOpening = true; @@ -880,18 +878,6 @@ $.widget( "ui.dialog", { if ( !instance._allowInteraction( event ) ) { event.preventDefault(); instance._focusTabbable(); - - // Support: jQuery >=3.4 <3.7 only - // In jQuery 3.4-3.6, there are multiple issues with focus/blur - // trigger chains or when triggering is done on a hidden element - // at least once. - // Trigger focus in a delay in addition if needed to avoid the issues. - // See https://github.com/jquery/jquery/issues/4382 - // See https://github.com/jquery/jquery/issues/4856 - // See https://github.com/jquery/jquery/issues/4950 - if ( jqMinor === "3.4." || jqMinor === "3.5." || jqMinor === "3.6." ) { - instance._delay( instance._restoreTabbableFocus ); - } } }.bind( this ) ); } diff --git a/ui/widgets/tabs.js b/ui/widgets/tabs.js index be4fe7e7a..465b48cec 100644 --- a/ui/widgets/tabs.js +++ b/ui/widgets/tabs.js @@ -857,32 +857,19 @@ $.widget( "ui.tabs", { this.xhr = $.ajax( this._ajaxSettings( anchor, event, eventData ) ); - // Support: jQuery <1.8 - // jQuery <1.8 returns false if the request is canceled in beforeSend, - // but as of 1.8, $.ajax() always returns a jqXHR object. - if ( this.xhr && this.xhr.statusText !== "canceled" ) { + if ( this.xhr.statusText !== "canceled" ) { this._addClass( tab, "ui-tabs-loading" ); panel.attr( "aria-busy", "true" ); this.xhr .done( function( response, status, jqXHR ) { + panel.html( response ); + that._trigger( "load", event, eventData ); - // support: jQuery <1.8 - // https://bugs.jquery.com/ticket/11778 - setTimeout( function() { - panel.html( response ); - that._trigger( "load", event, eventData ); - - complete( jqXHR, status ); - }, 1 ); + complete( jqXHR, status ); } ) .fail( function( jqXHR, status ) { - - // support: jQuery <1.8 - // https://bugs.jquery.com/ticket/11778 - setTimeout( function() { - complete( jqXHR, status ); - }, 1 ); + complete( jqXHR, status ); } ); } }, |