mirror of
https://github.com/hkalexling/Mango.git
synced 2025-08-02 10:55:30 -04:00
Limit max length in download table (fixes #244)
This commit is contained in:
parent
1199eb7a03
commit
921628ba6d
@ -68,7 +68,12 @@ const buildTable = (chapters) => {
|
|||||||
$('table').append(thead);
|
$('table').append(thead);
|
||||||
|
|
||||||
const rows = chapters.map(ch => {
|
const rows = chapters.map(ch => {
|
||||||
const tds = Object.values(ch).map(v => `<td>${v}</td>`).join('');
|
const tds = Object.values(ch).map(v => {
|
||||||
|
const maxLength = 40;
|
||||||
|
const shouldShrink = v.length > maxLength;
|
||||||
|
const content = shouldShrink ? `<span title="${v}">${v.substring(0, maxLength)}...</span><div uk-dropdown><span>${v}</span></div>` : v;
|
||||||
|
return `<td>${content}</td>`
|
||||||
|
}).join('');
|
||||||
return `<tr data-id="${ch.id}" data-title="${ch.title}">${tds}</tr>`;
|
return `<tr data-id="${ch.id}" data-title="${ch.title}">${tds}</tr>`;
|
||||||
});
|
});
|
||||||
const tbody = `<tbody id="selectable">${rows}</tbody>`;
|
const tbody = `<tbody id="selectable">${rows}</tbody>`;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user