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

fix: queue pagination

fix: toggleBtn in parse_state
This commit is contained in:
jcorporation 2018-07-16 21:39:27 +01:00
parent f4640a932c
commit e97d4a7250

View File

@ -170,13 +170,14 @@ function appRoute() {
}
else if (app.current.app == 'Queue' ) {
document.getElementById('QueueList').classList.add('opacity05');
/*
if (app.last.app != app.current.app) {
/* if (app.last.app != app.current.app) {
if (app.current.search.length < 2) {
setPagination(app.current.page);
}
}
*/
var btns = document.getElementById('searchqueuetag').getElementsByTagName('button');
for (var i = 0; i < btns.length; i++) {
btns[i].classList.remove('active');
@ -599,6 +600,7 @@ function parseStats(obj) {
function toggleBtn(btn, state) {
var b = document.getElementById(btn);
if (!b) return;
if (state == undefined)
state = b.classList.contains('active') ? 0 : 1;
if (state == 1) {
@ -784,11 +786,7 @@ function getQueue() {
if (app.current.search.length >= 2)
sendAPI({"cmd": "MPD_API_SEARCH_QUEUE", "data": {"mpdtag":app.current.filter, "offset":app.current.page, "searchstr": app.current.search}}, parseQueue);
else {
var queue_version = document.getElementById('QueueList').getAttribute('data-version');
if (last_state && queue_version != last_state.data.queue_version)
sendAPI({"cmd": "MPD_API_GET_QUEUE", "data": {"offset": app.current.page}}, parseQueue);
else
document.getElementById('QueueList').classList.remove('opacity05');
sendAPI({"cmd": "MPD_API_GET_QUEUE", "data": {"offset": app.current.page}}, parseQueue);
}
}