X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=blobdiff_plain;f=resources%2Fsrc%2Fjquery%2Fjquery.colorUtil.js;h=009be1aa73c28483561df929ebed1fb05a02f186;hb=add9bd191fd4d16250b301208600854cb52f6b33;hp=a5b136d9691834413309beafd0067b9848552cd6;hpb=12b7a7ea555ff4bda637b60f28e069a3b22873f4;p=lhc%2Fweb%2Fwiklou.git diff --git a/resources/src/jquery/jquery.colorUtil.js b/resources/src/jquery/jquery.colorUtil.js index a5b136d969..009be1aa73 100644 --- a/resources/src/jquery/jquery.colorUtil.js +++ b/resources/src/jquery/jquery.colorUtil.js @@ -6,7 +6,7 @@ * Mostly based on other plugins and functions (linted and optimized a little). * Sources cited inline. */ -( function ( $ ) { +( function () { /** * @class jQuery.colorUtil * @singleton @@ -29,6 +29,9 @@ if ( color && Array.isArray( color ) && color.length === 3 ) { return color; } + if ( typeof color !== 'string' ) { + return undefined; + } // Look for rgb(num,num,num) // eslint-disable-next-line no-cond-assign @@ -77,7 +80,7 @@ } // Otherwise, we're most likely dealing with a named color - return $.colorUtil.colors[ $.trim( color ).toLowerCase() ]; + return $.colorUtil.colors[ color.trim().toLowerCase() ]; }, /** @@ -262,4 +265,4 @@ }; -}( jQuery ) ); +}() );