Add a More-button for collapsing the list after the first horizontal ruler

This commit is contained in:
Paul van Tilburg 2018-01-03 20:44:59 +01:00
parent 4dd1fef41b
commit 94a3d3ebc1
1 changed files with 10 additions and 0 deletions

View File

@ -97,6 +97,16 @@ function updateListHTML(listElem) {
$("ul > li", listHtmlElem).has('input[type="checkbox"]')
.parent()
.addClass("tasklist");
if (listHtmlElem.find('hr').length) {
listHtmlElem.find('hr')
.nextAll()
.wrapAll('<div class="collapse list-more"/>')
listHtmlElem.append('<div class="row justify-content-center">' +
'<button class="btn btn-sm btn-light text-dark" data-toggle="collapse" ' +
'data-target=".list[data-list-id=\'' + listId + '\'] .list-more">' +
'Meer…</button>' +
'</div>');
}
}).fail(function(html, textMsg, error) {
listHtmlElem.html("<h3><i>Kan lijst niet tonen!</i></h3>" +
"<p class='pt-2'><small><i>(Technische foutmelding: " + error +