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

Feat: popover menu for last played list

This commit is contained in:
jcorporation 2018-11-15 21:15:15 +00:00
parent 4a6e0de158
commit b764580a69

View File

@ -1533,6 +1533,8 @@ function parseLastPlayed(obj) {
var row = document.createElement('tr');
row.setAttribute('data-songpos', (obj.data[i].Pos + 1));
row.setAttribute('data-uri', obj.data[i].uri);
row.setAttribute('data-name', obj.data[i].Title);
row.setAttribute('data-type', 'song');
var tds = '';
for (var c = 0; c < settings.colsQueueLastPlayed.length; c++) {
tds += '<td data-col="' + settings.colsQueueLastPlayed[c] + '">' + obj.data[i][settings.colsQueueLastPlayed[c]] + '</td>';
@ -2401,9 +2403,7 @@ function hideMenu() {
function showMenu(el, event) {
event.preventDefault();
event.stopPropagation();
hideMenu();
if (el.getAttribute('data-init'))
return;
@ -2465,6 +2465,12 @@ function showMenu(el, event) {
addMenuItem({"cmd": "delQueueSong", "options": ["range", (parseInt(el.parentNode.parentNode.getAttribute('data-songpos'))-1), -1]}, 'Remove all downwards') +
(uri.indexOf('http') == -1 ? addMenuItem({"cmd": "songDetails", "options": [uri]}, 'Songdetails') : '');
}
else if (app.current.app == 'Queue' && app.current.tab == 'LastPlayed') {
menu += addMenuItem({"cmd": "appendQueue", "options": [type, uri, name]}, 'Append to queue') +
addMenuItem({"cmd": "replaceQueue", "options": [type, uri, name]}, 'Replace queue') +
addMenuItem({"cmd": "showAddToPlaylist", "options": [uri]}, 'Add to playlist') +
(uri.indexOf('http') == -1 ? addMenuItem({"cmd": "songDetails", "options": [uri]}, 'Songdetails') : '');
}
new Popover(el, { trigger: 'click', delay: 0, dismissible: true, template: '<div class="popover" role="tooltip">' +
'<div class="arrow"></div>' +