rviscomi / trunk8

jQuery Truncation Plugin -- THIS PROJECT IS NO LONGER MAINTAINED
MIT License
703 stars 95 forks source link

onTruncate callback has no way to reference truncated element #81

Open gavin310 opened 6 years ago

gavin310 commented 6 years ago

Thanks for the excellent plugin. In the onTruncate callback, I want to do something with the element that has been truncated (highlight, add styles, javascript, etc.) It looks like the onTruncate callback is called with no reference to the element that was truncated, so it's impossible to know which element was truncated. To fix this I made a very simple change.

Changing line 232 from:

settings.onTruncate();

to:

settings.onTruncate(this);

It seems to me this should be included in the next version. (Sorry, I don't use git so I cannot commit.)