mirror of
https://github.com/hkalexling/Mango.git
synced 2025-08-03 03:15:31 -04:00
Only show tooltips for truncated titles
This commit is contained in:
parent
a5daded453
commit
aa09f3a86f
@ -1,7 +1,15 @@
|
|||||||
const truncate = () => {
|
const truncate = () => {
|
||||||
$('.acard .uk-card-title').each((i, e) => {
|
$('.acard .uk-card-title').each((i, e) => {
|
||||||
$(e).dotdotdot({
|
$(e).dotdotdot({
|
||||||
truncate: 'letter'
|
truncate: 'letter',
|
||||||
|
callback: (truncated) => {
|
||||||
|
if (truncated) {
|
||||||
|
$(e).attr('uk-tooltip', $(e).attr('data-title'));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$(e).removeAttr('uk-tooltip');
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
<%- if t.entries.size > 0 -%>
|
<%- if t.entries.size > 0 -%>
|
||||||
<div class="uk-card-badge uk-label"><%= (percentage[i] * 100).round(1) %>%</div>
|
<div class="uk-card-badge uk-label"><%= (percentage[i] * 100).round(1) %>%</div>
|
||||||
<%- end -%>
|
<%- end -%>
|
||||||
<h3 class="uk-card-title break-word" uk-tooltip="<%= t.title.gsub("\"", """) %>"><%= t.title %></h3>
|
<h3 class="uk-card-title break-word" data-title="<%= t.title.gsub("\"", """) %>"><%= t.title %></h3>
|
||||||
<p><%= t.size %> entries</p>
|
<p><%= t.size %> entries</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
<%- if t.entries.size > 0 -%>
|
<%- if t.entries.size > 0 -%>
|
||||||
<div class="uk-card-badge uk-label"><%= (titles_percentage[i] * 100).round(1) %>%</div>
|
<div class="uk-card-badge uk-label"><%= (titles_percentage[i] * 100).round(1) %>%</div>
|
||||||
<%- end -%>
|
<%- end -%>
|
||||||
<h3 class="uk-card-title break-word" uk-tooltip="<%= t.title.gsub("\"", """) %>"><%= t.title %></h3>
|
<h3 class="uk-card-title break-word" data-title="<%= t.title.gsub("\"", """) %>"><%= t.title %></h3>
|
||||||
<p><%= t.size %> entries</p>
|
<p><%= t.size %> entries</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -61,7 +61,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="uk-card-body">
|
<div class="uk-card-body">
|
||||||
<div class="uk-card-badge uk-label"><%= (percentage[i] * 100).round(1) %>%</div>
|
<div class="uk-card-badge uk-label"><%= (percentage[i] * 100).round(1) %>%</div>
|
||||||
<h3 class="uk-card-title break-word" uk-tooltip="<%= e.title.gsub("\"", """) %>"><%= e.title %></h3>
|
<h3 class="uk-card-title break-word" data-title="<%= e.title.gsub("\"", """) %>"><%= e.title %></h3>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user