1
0
mirror of https://github.com/SuperBFG7/ympd synced 2024-11-05 22:36:16 +00:00

Feat: collapse title list in album view

This commit is contained in:
jcorporation 2018-10-15 20:00:22 +01:00
parent 9ef69f3c08
commit 997928790c
2 changed files with 15 additions and 5 deletions

View File

@ -33,10 +33,6 @@ button {
} }
.card {
min-height: 350px;
}
@media only screen and (max-width: 576px) { @media only screen and (max-width: 576px) {
.header-logo { .header-logo {
display:none !important; display:none !important;

View File

@ -1341,7 +1341,11 @@ function parseListDBtags(obj) {
' <div class="card-body">' + ' <div class="card-body">' +
' <h5 class="card-title" id="albumartist' + id + '"></h5>' + ' <h5 class="card-title" id="albumartist' + id + '"></h5>' +
' <h4 class="card-title">' + obj.data[i].value + '</h4>' + ' <h4 class="card-title">' + obj.data[i].value + '</h4>' +
' <table class="table table-sm table-hover" id="tbl' + id + '"><tbody></tbody></table'+ ' <a class="color-darkgrey" data-toggle="collapse" href="#collapse' + id +'" id="collapseLink' + id +'">' +
' <span class="material-icons">keyboard_arrow_right</span> Show Titles</a> ' +
' <div class="collapse" id="collapse' + id +'">' +
' <table class="table table-sm table-hover" id="tbl' + id + '"><tbody></tbody></table>'+
' </div>' +
' </div>'+ ' </div>'+
'</div>'; '</div>';
@ -1433,6 +1437,16 @@ function parseListTitles(obj) {
img.setAttribute('data-type', 'dir'); img.setAttribute('data-type', 'dir');
document.getElementById('albumartist' + id).innerText = obj.albumartist; document.getElementById('albumartist' + id).innerText = obj.albumartist;
var titleTable = document.getElementById('collapseLink' + id);
var myCollapseInit = new Collapse(titleTable);
document.getElementById('collapse' + id).addEventListener('show.bs.collapse', function() {
titleTable.innerHTML = '<span class="material-icons">keyboard_arrow_down</span> Hide Titles';
}, false);
document.getElementById('collapse' + id).addEventListener('hidden.bs.collapse', function() {
titleTable.innerHTML = '<span class="material-icons">keyboard_arrow_right</span> Show Titles';
}, false);
var titleList = ''; var titleList = '';
var nrItems = obj.data.length; var nrItems = obj.data.length;
for (var i = 0; i < nrItems; i++) { for (var i = 0; i < nrItems; i++) {