mirror of
				https://github.com/SuperBFG7/ympd
				synced 2025-10-31 13:53:00 +00:00 
			
		
		
		
	Fix buttons shuffle and clear in queue card
This commit is contained in:
		| @@ -122,10 +122,10 @@ | |||||||
|             </div> |             </div> | ||||||
|           </div> |           </div> | ||||||
|           <div id="queue-actions" class="btn-group mr-2"> |           <div id="queue-actions" class="btn-group mr-2"> | ||||||
|             <button type="button" class="btn btn-secondary" onclick="socket.send('MPD_API_SEND_SHUFFLE');" title="Shuffle queue"> |             <button type="button" class="btn btn-secondary" onclick="shuffleQueue();" title="Shuffle queue"> | ||||||
|               <span class="material-icons">shuffle</span> |               <span class="material-icons">shuffle</span> | ||||||
|             </button> |             </button> | ||||||
|             <button type="button" class="btn btn-secondary" onclick="socket.send('MPD_API_RM_ALL');" title="Clear queue"> |             <button type="button" class="btn btn-secondary" onclick="clearQueue();" title="Clear queue"> | ||||||
|               <span class="material-icons">clear_all</span> |               <span class="material-icons">clear_all</span> | ||||||
|             </button> |             </button> | ||||||
|             <button type="button" class="btn btn-secondary" data-toggle="modal" data-target="#savequeue" title="Save queue"> |             <button type="button" class="btn btn-secondary" data-toggle="modal" data-target="#savequeue" title="Save queue"> | ||||||
|   | |||||||
| @@ -954,6 +954,14 @@ function updatePlayIcon(obj) { | |||||||
|     }     |     }     | ||||||
| } | } | ||||||
|  |  | ||||||
|  | function shuffleQueue() { | ||||||
|  |     sendAPI({"cmd":"MPD_API_SEND_SHUFFLE"}); | ||||||
|  | } | ||||||
|  |  | ||||||
|  | function clearQueue() { | ||||||
|  |     sendAPI({"cmd":"MPD_API_RM_ALL"}); | ||||||
|  | } | ||||||
|  |  | ||||||
| function sendAPI(request, callback) { | function sendAPI(request, callback) { | ||||||
|     $.ajax({url: "/api", contentType:"application/json", method: "POST", data: JSON.stringify(request), success: callback }); |     $.ajax({url: "/api", contentType:"application/json", method: "POST", data: JSON.stringify(request), success: callback }); | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 jcorporation
					jcorporation