Skip to content
This repository was archived by the owner on Dec 2, 2022. It is now read-only.

Commit be8131c

Browse files
committed
Fix deprecated jQuery
Signed-off-by: Kevin Provance <kevin.provance@gmail.com>
1 parent 81387a7 commit be8131c

File tree

1 file changed

+19
-13
lines changed

1 file changed

+19
-13
lines changed

redux-core/inc/fields/spinner/vendor/jquery.ui.spinner.js

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@
1717
* Deprecated boxSupport was removed, since Redux does not use boxSupport.
1818
*/
1919

20+
/* global jQuery */
21+
2022
jQuery.uaMatch = function( ua ) {
23+
'use strict';
24+
2125
var match;
2226

2327
ua = ua.toLowerCase();
@@ -34,6 +38,8 @@ jQuery.uaMatch = function( ua ) {
3438
};
3539

3640
(function( $ ) {
41+
'use strict';
42+
3743
var active = 'ui-state-active';
3844
var hover = 'ui-state-hover';
3945
var disabled = 'ui-state-disabled';
@@ -239,7 +245,7 @@ jQuery.uaMatch = function( ua ) {
239245
return false;
240246
}
241247

242-
wrapper = input.wrap( '<span class="spinner-wrpr" />' ).css(
248+
wrapper = input.wrap( '<span class="spinner-wrpr" />' ).css(
243249
{
244250
width: ( _this.oWidth = input.outerWidth() ) - buttonWidth + '!important',
245251
marginRight: '30px',
@@ -286,7 +292,7 @@ jQuery.uaMatch = function( ua ) {
286292
}
287293

288294
if ( 'hover' === showOn || 'both' === showOn ) {
289-
buttons.add( input ).bind(
295+
buttons.add( input ).on(
290296
'mouseenter' + eventNamespace,
291297
function() {
292298
setHoverDelay(
@@ -298,7 +304,7 @@ jQuery.uaMatch = function( ua ) {
298304
}
299305
);
300306
}
301-
).bind(
307+
).on(
302308
'mouseleave' + eventNamespace,
303309
function() {
304310
setHoverDelay(
@@ -335,15 +341,15 @@ jQuery.uaMatch = function( ua ) {
335341

336342
return false;
337343
}
338-
).bind(
344+
).on(
339345
'selectstart',
340346
function() {
341347
return false;
342348
}
343349
);
344350
}
345351

346-
input.bind(
352+
input.on(
347353
'keydown' + eventNamespace,
348354
function( e ) {
349355
var dir;
@@ -408,7 +414,7 @@ jQuery.uaMatch = function( ua ) {
408414
return false;
409415
}
410416
}
411-
).bind(
417+
).on(
412418
'keyup' + eventNamespace,
413419
function( e ) {
414420
if ( e.ctrl || e.alt ) {
@@ -433,19 +439,19 @@ jQuery.uaMatch = function( ua ) {
433439
return false;
434440
}
435441
}
436-
).bind(
442+
).on(
437443
'keypress' + eventNamespace,
438444
function( e ) {
439445
if ( invalidKey( e.keyCode, e.charCode ) ) {
440446
return false;
441447
}
442448
}
443-
).bind(
449+
).on(
444450
'change' + eventNamespace,
445451
function() {
446452
_this._change();
447453
}
448-
).bind(
454+
).on(
449455
'focus' + eventNamespace,
450456
function() {
451457
function selectAll() {
@@ -465,7 +471,7 @@ jQuery.uaMatch = function( ua ) {
465471
_this.showButtons();
466472
}
467473
}
468-
).bind(
474+
).on(
469475
'blur' + eventNamespace,
470476
function() {
471477
_this.focused = false;
@@ -565,10 +571,10 @@ jQuery.uaMatch = function( ua ) {
565571

566572
_this._change();
567573

568-
input.unbind( mouseWheelEventName + eventNamespace );
574+
input.off( mouseWheelEventName + eventNamespace );
569575

570576
if ( options.mouseWheel ) {
571-
input.bind( mouseWheelEventName + eventNamespace, _this._mouseWheel );
577+
input.on( mouseWheelEventName + eventNamespace, _this._mouseWheel );
572578
}
573579
},
574580
_mouseWheel: function( e ) {
@@ -755,7 +761,7 @@ jQuery.uaMatch = function( ua ) {
755761
destroy: function() {
756762
this.wrapper.remove();
757763

758-
this.element.unbind( eventNamespace ).css(
764+
this.element.off( eventNamespace ).css(
759765
{
760766
width: this.oWidth,
761767
marginRight: this.oMargin

0 commit comments

Comments
 (0)