From: Fomafix Date: Fri, 23 Jun 2017 06:45:29 +0000 (+0200) Subject: Use $.noop instead of function () {} X-Git-Tag: 1.31.0-rc.0~2913^2 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dcompta/comptes/%28%5B%5E?a=commitdiff_plain;h=4626e7ddb14e680e3d35e0ac6bd436e1f18a68a3;p=lhc%2Fweb%2Fwiklou.git Use $.noop instead of function () {} $.noop (https://api.jquery.com/jQuery.noop/) already provides an empty function. Change-Id: I7f1ca20a894d0469cb7bcb72c81722070e040956 --- diff --git a/resources/src/mediawiki.special/mediawiki.special.apisandbox.js b/resources/src/mediawiki.special/mediawiki.special.apisandbox.js index 73c3c450c7..694f86ae14 100644 --- a/resources/src/mediawiki.special/mediawiki.special.apisandbox.js +++ b/resources/src/mediawiki.special/mediawiki.special.apisandbox.js @@ -1415,8 +1415,7 @@ if ( $.isFunction( f.focus ) ) { f.focus(); } - }, - doNothing = function () {}; + }; // This is something of a hack. We always want the 'format' and // 'action' parameters from the main module to be specified, @@ -1642,7 +1641,7 @@ // it makes it too hard to read and our "disabled" // isn't really disabled. widgetField.onFieldDisable( false ); - widgetField.onFieldDisable = doNothing; + widgetField.onFieldDisable = $.noop; if ( Util.apiBool( pi.parameters[ i ].deprecated ) ) { deprecatedItems.push( widgetField, helpField );