1
0
mirror of https://github.com/SuperBFG7/ympd synced 2024-12-25 02:20:27 +00:00

Fix: advanced search tag selection

This commit is contained in:
jcorporation 2018-11-28 14:41:13 +00:00
parent 1e702d96b3
commit aa4c761da4
2 changed files with 7 additions and 5 deletions

View File

@ -145,7 +145,7 @@
<form id="searchqueue" class="flex-grow-1">
<div class="input-group mr-2">
<div class="input-group-prepend">
<button title="Select tags to search" class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown">
<button title="Select tag to search" class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown">
<span class="material-icons">search</span>
<span id="searchqueuetagsdesc">Any Tag</span>
</button>
@ -521,7 +521,7 @@
<form id="search" class="flex-grow-1">
<div class="input-group mr-2">
<div class="input-group-prepend">
<button title="Select tags to search" class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown">
<button title="Select tag to search" class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown">
<span class="material-icons">search</span>
<span id="searchtagsdesc">Any Tag</span>
</button>

View File

@ -615,8 +615,10 @@ function appInit() {
}, false);
document.getElementById('searchtags').addEventListener('click', function(event) {
if (event.target.nodeName == 'BUTTON')
appGoto(app.current.app, app.current.tab, app.current.view, '0/' + event.target.getAttribute('data-tag') + '/' + app.current.search);
if (event.target.nodeName == 'BUTTON') {
app.current.filter = event.target.getAttribute('data-tag');
search(domCache.searchstr.value);
}
}, false);
document.getElementById('searchqueuestr').addEventListener('keyup', function(event) {
@ -1727,7 +1729,7 @@ function parseSearch(obj) {
document.getElementById('panel-heading-search').innerText = obj.totalEntities + ' Songs found';
document.getElementById('cardFooterSearch').innerText = obj.totalEntities + ' Songs found';
}
else if (obj.returnedEntities < settings.maxElementsPerPage) {
else if (obj.returnedEntities + app.current.page < settings.maxElementsPerPage) {
document.getElementById('panel-heading-search').innerText = obj.returnedEntities + ' Songs found';
document.getElementById('cardFooterSearch').innerText = obj.returnedEntities + ' Songs found';
}