mirror of
				https://github.com/SuperBFG7/ympd
				synced 2025-10-31 05:43:01 +00:00 
			
		
		
		
	fix: queue pagination
fix: toggleBtn in parse_state
This commit is contained in:
		| @@ -170,13 +170,14 @@ function appRoute() { | |||||||
|     }     |     }     | ||||||
|     else if (app.current.app == 'Queue' ) { |     else if (app.current.app == 'Queue' ) { | ||||||
|         document.getElementById('QueueList').classList.add('opacity05'); |         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) { |             if (app.current.search.length < 2) { | ||||||
|                 setPagination(app.current.page);         |                 setPagination(app.current.page);         | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
| */ | */ | ||||||
|  |  | ||||||
|         var btns = document.getElementById('searchqueuetag').getElementsByTagName('button'); |         var btns = document.getElementById('searchqueuetag').getElementsByTagName('button'); | ||||||
|         for (var i = 0; i < btns.length; i++) { |         for (var i = 0; i < btns.length; i++) { | ||||||
|             btns[i].classList.remove('active'); |             btns[i].classList.remove('active'); | ||||||
| @@ -599,6 +600,7 @@ function parseStats(obj) { | |||||||
|  |  | ||||||
| function toggleBtn(btn, state) { | function toggleBtn(btn, state) { | ||||||
|     var b = document.getElementById(btn); |     var b = document.getElementById(btn); | ||||||
|  |     if (!b) return; | ||||||
|     if (state == undefined) |     if (state == undefined) | ||||||
|         state = b.classList.contains('active') ? 0 : 1; |         state = b.classList.contains('active') ? 0 : 1; | ||||||
|     if (state == 1) { |     if (state == 1) { | ||||||
| @@ -784,11 +786,7 @@ function getQueue() { | |||||||
|     if (app.current.search.length >= 2)  |     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); |         sendAPI({"cmd": "MPD_API_SEARCH_QUEUE", "data": {"mpdtag":app.current.filter, "offset":app.current.page, "searchstr": app.current.search}}, parseQueue); | ||||||
|     else { |     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); |         sendAPI({"cmd": "MPD_API_GET_QUEUE", "data": {"offset": app.current.page}}, parseQueue); | ||||||
|         else |  | ||||||
|             document.getElementById('QueueList').classList.remove('opacity05'); |  | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 jcorporation
					jcorporation