From aa4c761da45bee17518211598b4d10581280cb14 Mon Sep 17 00:00:00 2001 From: jcorporation Date: Wed, 28 Nov 2018 14:41:13 +0000 Subject: [PATCH] Fix: advanced search tag selection --- htdocs/index.html | 4 ++-- htdocs/js/mympd.js | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/htdocs/index.html b/htdocs/index.html index 84be1cb..9bffe67 100644 --- a/htdocs/index.html +++ b/htdocs/index.html @@ -145,7 +145,7 @@
- @@ -521,7 +521,7 @@
- diff --git a/htdocs/js/mympd.js b/htdocs/js/mympd.js index 7e0ae79..3b6f56a 100644 --- a/htdocs/js/mympd.js +++ b/htdocs/js/mympd.js @@ -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'; }