Watch the title element size for change

This commit is contained in:
Alex Ling 2020-04-01 06:13:03 +00:00
parent aa09f3a86f
commit 58e96cd4fe

View File

@ -2,6 +2,7 @@ const truncate = () => {
$('.acard .uk-card-title').each((i, e) => { $('.acard .uk-card-title').each((i, e) => {
$(e).dotdotdot({ $(e).dotdotdot({
truncate: 'letter', truncate: 'letter',
watch: true,
callback: (truncated) => { callback: (truncated) => {
if (truncated) { if (truncated) {
$(e).attr('uk-tooltip', $(e).attr('data-title')); $(e).attr('uk-tooltip', $(e).attr('data-title'));
@ -14,6 +15,4 @@ const truncate = () => {
}); });
}; };
$(() => { truncate();
truncate();
});