aboutsummaryrefslogtreecommitdiffstats
path: root/ui/widgets/spinner.js
diff options
context:
space:
mode:
authorMichał Gołębiowski-Owczarek <m.goleb@gmail.com>2024-05-01 00:54:19 +0200
committerMichał Gołębiowski-Owczarek <m.goleb@gmail.com>2024-05-15 00:38:40 +0200
commitbb49bd794bc8ea4238162725b518fb46234f3cf9 (patch)
treedb7b6152daac9f2c6b5fd051ab5d3b7ec7382791 /ui/widgets/spinner.js
parentdaa6fb55b35065c49c0ffc879c94627bbf85404c (diff)
downloadjquery-ui-bb49bd794bc8ea4238162725b518fb46234f3cf9.tar.gz
jquery-ui-bb49bd794bc8ea4238162725b518fb46234f3cf9.zip
All: Drop support for IE & some other browsers (but mostly IE)
Closes gh-2249
Diffstat (limited to 'ui/widgets/spinner.js')
-rw-r--r--ui/widgets/spinner.js29
1 files changed, 3 insertions, 26 deletions
diff --git a/ui/widgets/spinner.js b/ui/widgets/spinner.js
index b92b8ab52..d999d85d7 100644
--- a/ui/widgets/spinner.js
+++ b/ui/widgets/spinner.js
@@ -27,7 +27,6 @@
"./button",
"../version",
"../keycode",
- "../safe-active-element",
"../widget"
], factory );
} else {
@@ -131,11 +130,6 @@ $.widget( "ui.spinner", {
this.previous = this.element.val();
},
blur: function( event ) {
- if ( this.cancelBlur ) {
- delete this.cancelBlur;
- return;
- }
-
this._stop();
this._refresh();
if ( this.previous !== this.element.val() ) {
@@ -143,7 +137,7 @@ $.widget( "ui.spinner", {
}
},
mousewheel: function( event, delta ) {
- var activeElement = $.ui.safeActiveElement( this.document[ 0 ] );
+ var activeElement = this.document[ 0 ].activeElement;
var isActive = this.element[ 0 ] === activeElement;
if ( !isActive || !delta ) {
@@ -171,20 +165,13 @@ $.widget( "ui.spinner", {
// If the input is focused then this.previous is properly set from
// when the input first received focus. If the input is not focused
// then we need to set this.previous based on the value before spinning.
- previous = this.element[ 0 ] === $.ui.safeActiveElement( this.document[ 0 ] ) ?
+ previous = this.element[ 0 ] === this.document[ 0 ].activeElement ?
this.previous : this.element.val();
function checkFocus() {
- var isActive = this.element[ 0 ] === $.ui.safeActiveElement( this.document[ 0 ] );
+ var isActive = this.element[ 0 ] === this.document[ 0 ].activeElement;
if ( !isActive ) {
this.element.trigger( "focus" );
this.previous = previous;
-
- // support: IE
- // IE sets focus asynchronously, so we need to check if focus
- // moved off of the input because the user clicked on the button.
- this._delay( function() {
- this.previous = previous;
- } );
}
}
@@ -192,16 +179,6 @@ $.widget( "ui.spinner", {
event.preventDefault();
checkFocus.call( this );
- // Support: IE
- // IE doesn't prevent moving focus even with event.preventDefault()
- // so we set a flag to know when we should ignore the blur event
- // and check (again) if focus moved off of the input.
- this.cancelBlur = true;
- this._delay( function() {
- delete this.cancelBlur;
- checkFocus.call( this );
- } );
-
if ( this._start( event ) === false ) {
return;
}