X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=resources%2Fjquery%2Fjquery.autoEllipsis.js;h=04bb301c2334410f814ae8ad4373a8b300b6cfdf;hb=e9186da841917ec3055dbeb44aacd03d44f33fde;hp=23ba074052a3b4f783362d4f3a5ac0c588f6d100;hpb=558480e3ed462cd20ddc8b5fc8245bfd7b831772;p=lhc%2Fweb%2Fwiklou.git diff --git a/resources/jquery/jquery.autoEllipsis.js b/resources/jquery/jquery.autoEllipsis.js index 23ba074052..04bb301c23 100644 --- a/resources/jquery/jquery.autoEllipsis.js +++ b/resources/jquery/jquery.autoEllipsis.js @@ -3,10 +3,12 @@ */ ( function ( $ ) { -// Cache ellipsed substrings for every string-width-position combination -var cache = { }; -// Use a separate cache when match highlighting is enabled -var matchTextCache = { }; +var + // Cache ellipsed substrings for every string-width-position combination + cache = { }, + + // Use a separate cache when match highlighting is enabled + matchTextCache = { }; $.fn.autoEllipsis = function ( options ) { options = $.extend( { @@ -19,7 +21,7 @@ $.fn.autoEllipsis = function ( options ) { $(this).each( function () { var $container, $trimmableText, text, trimmableText, w, pw, - l, r, i, side, + l, r, i, side, m, $el = $(this); if ( options.restoreText ) { if ( !$el.data( 'autoEllipsis.originalText' ) ) { @@ -90,7 +92,7 @@ $.fn.autoEllipsis = function ( options ) { l = 0; r = trimmableText.length; do { - var m = Math.ceil( ( l + r ) / 2 ); + m = Math.ceil( ( l + r ) / 2 ); $trimmableText.text( trimmableText.substr( 0, m ) + '...' ); if ( $trimmableText.width() + pw > w ) { // Text is too long