Only show tooltips for truncated titles

This commit is contained in:
Alex Ling
2020-04-01 05:59:46 +00:00
parent a5daded453
commit aa09f3a86f
3 changed files with 12 additions and 4 deletions

View File

@@ -1,7 +1,15 @@
const truncate = () => {
$('.acard .uk-card-title').each((i, e) => {
$(e).dotdotdot({
truncate: 'letter'
truncate: 'letter',
callback: (truncated) => {
if (truncated) {
$(e).attr('uk-tooltip', $(e).attr('data-title'));
}
else {
$(e).removeAttr('uk-tooltip');
}
}
});
});
};