From: Timo Tijhof Date: Thu, 5 Oct 2017 20:30:20 +0000 (+0100) Subject: jquery.ui: Fix various jQuery Migrate warnings X-Git-Tag: 1.31.0-rc.0~1857 X-Git-Url: http://git.cyclocoop.org/%22%2C%20generer_url_ecrire%28?a=commitdiff_plain;h=011367431745e51488731342ffc2fe1981f71bc0;p=lhc%2Fweb%2Fwiklou.git jquery.ui: Fix various jQuery Migrate warnings These are the most common three, triggered whenever a jQuery UI dialog is created. > JQMIGRATE: jQuery.fn.bind() is deprecated > JQMIGRATE: jQuery.expr.filters is deprecated; use jQuery.expr.pseudos > JQMIGRATE: jQuery.fn.andSelf() was removed, use jQuery.fn.addBack() Bug: T169385 Change-Id: I717f2580e3aae443cb9fc734de8f4b0dd8825b8c --- diff --git a/resources/lib/jquery.ui/PATCHES b/resources/lib/jquery.ui/PATCHES index bcff2ac3b1..321b8b9eb0 100644 --- a/resources/lib/jquery.ui/PATCHES +++ b/resources/lib/jquery.ui/PATCHES @@ -1,5 +1,7 @@ jquery.ui.core.js * I7ffbfd2e5 Avoid deprecated jQuery.expr[":"]. +* I717f2580e Avoid deprecated jQuery.expr.filters. +* I717f2580e Avoid deprecated jQuery.fn.andSelf(). jquery.ui.draggable.js @@ -11,10 +13,12 @@ jquery.ui.draggable.js jquery.ui.datepicker * 19531f3c23 Add translations in de-AT and de-CH +* I717f2580e Avoid deprecated jQuery.expr.filters. jquery.ui.widget.js * I7ffbfd2e5 Avoid deprecated jQuery.expr[":"]. +* I717f2580e Avoid deprecated jQuery.fn.bind(). themes/smoothness/jquery.ui.theme.css diff --git a/resources/lib/jquery.ui/jquery.ui.core.js b/resources/lib/jquery.ui/jquery.ui.core.js index 19f0069e25..88da235654 100644 --- a/resources/lib/jquery.ui/jquery.ui.core.js +++ b/resources/lib/jquery.ui/jquery.ui.core.js @@ -151,8 +151,8 @@ function focusable( element, isTabIndexNotNaN ) { } function visible( element ) { - return $.expr.filters.visible( element ) && - !$( element ).parents().andSelf().filter(function() { + return $.expr.pseudos.visible( element ) && + !$( element ).parents().addBack().filter(function() { return $.css( this, "visibility" ) === "hidden"; }).length; } diff --git a/resources/lib/jquery.ui/jquery.ui.datepicker.js b/resources/lib/jquery.ui/jquery.ui.datepicker.js index cd5d49018d..15982fde51 100644 --- a/resources/lib/jquery.ui/jquery.ui.datepicker.js +++ b/resources/lib/jquery.ui/jquery.ui.datepicker.js @@ -783,7 +783,7 @@ $.extend(Datepicker.prototype, { _findPos: function(obj) { var inst = this._getInst(obj); var isRTL = this._get(inst, 'isRTL'); - while (obj && (obj.type == 'hidden' || obj.nodeType != 1 || $.expr.filters.hidden(obj))) { + while (obj && (obj.type == 'hidden' || obj.nodeType != 1 || $.expr.pseudos.hidden(obj))) { obj = obj[isRTL ? 'previousSibling' : 'nextSibling']; } var position = $(obj).offset(); diff --git a/resources/lib/jquery.ui/jquery.ui.widget.js b/resources/lib/jquery.ui/jquery.ui.widget.js index 4d84afcf39..9836fc99f2 100644 --- a/resources/lib/jquery.ui/jquery.ui.widget.js +++ b/resources/lib/jquery.ui/jquery.ui.widget.js @@ -409,7 +409,7 @@ $.Widget.prototype = { if ( selector ) { delegateElement.delegate( selector, eventName, handlerProxy ); } else { - element.bind( eventName, handlerProxy ); + element.on( eventName, handlerProxy ); } }); },