// Cache ellipsed substrings for every string-width-position combination
var cache = { };
-// Use a seperate cache when match highlighting is enabled
+// Use a separate cache when match highlighting is enabled
var matchTextCache = { };
$.fn.autoEllipsis = function( options ) {
$el.text( $el.data( 'autoEllipsis.originalText' ) );
}
}
-
+
// container element - used for measuring against
var $container = $el;
// trimmable text element - only the text within this element will be trimmed
.empty()
.append( $trimmableText );
}
-
+
var text = $container.text();
var trimmableText = $trimmableText.text();
var w = $container.width();
return;
}
}
-
+
if ( $trimmableText.width() + pw > w ) {
switch ( options.position ) {
case 'right':
} else {
cache[text][w][options.position] = $container.html();
}
-
+
} );
};