mirror of
https://gitlab.science.ru.nl/technicie/MarietjeDjango.git
synced 2025-12-10 05:22:22 +01:00
completely fixed the arrows
This commit is contained in:
@ -53,7 +53,6 @@ $(function () {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
$.post('/api/report', {id: songId, msg: message, csrfmiddlewaretoken: csrf_token}, function (result) {
|
$.post('/api/report', {id: songId, msg: message, csrfmiddlewaretoken: csrf_token}, function (result) {
|
||||||
console.log(result);
|
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
createAlert('success', 'Thanks for your song report!');
|
createAlert('success', 'Thanks for your song report!');
|
||||||
}
|
}
|
||||||
@ -208,18 +207,17 @@ function renderQueue(playNextAt, now)
|
|||||||
//checks if id is the first item and returns false if the previous song is not Marietje, while the current song is.
|
//checks if id is the first item and returns false if the previous song is not Marietje, while the current song is.
|
||||||
if(id === 0){
|
if(id === 0){
|
||||||
var requestPrev = false
|
var requestPrev = false
|
||||||
//
|
|
||||||
} else {
|
} else {
|
||||||
var requestPrev = !((queue[id-1].requested_by !== 'Marietje') && (requestedBy === 'Marietje'))
|
var requestPrev = !((queue[id-1].requested_by !== 'Marietje') && (requestedBy === 'Marietje'))
|
||||||
|
var prevItem = queue[id-1].id
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(requestNext, requestPrev, requestCurr);
|
|
||||||
var canDelete = song.can_move_down || canMoveSongs;
|
var canDelete = song.can_move_down || canMoveSongs;
|
||||||
var canMoveUp = canMoveSongs && requestPrev || canDeletePrevious && requestCurr && requestPrev;
|
var canMoveUp = canMoveSongs && requestPrev || canDeletePrevious && requestCurr && requestPrev;
|
||||||
var canMoveDown = canMoveSongs && requestNext || canDelete && requestCurr && requestNext;
|
var canMoveDown = canMoveSongs && requestNext || canDelete && requestCurr && requestNext;
|
||||||
var artist = song.song.artist.trim() === '' ? '?' : song.song.artist;
|
var artist = song.song.artist.trim() === '' ? '?' : song.song.artist;
|
||||||
var title = song.song.title.trim() === '' ? '?' : song.song.title;
|
var title = song.song.title.trim() === '' ? '?' : song.song.title;
|
||||||
var prevId = song.id - 1;
|
|
||||||
|
|
||||||
showTime = showTimeToPlay ? (timeToPlay < 0 ? '' : timeToPlay.secondsToMMSS()) : (playNextAt < now ? '' : playNextAt.timestampToHHMMSS())
|
showTime = showTimeToPlay ? (timeToPlay < 0 ? '' : timeToPlay.secondsToMMSS()) : (playNextAt < now ? '' : playNextAt.timestampToHHMMSS())
|
||||||
|
|
||||||
@ -228,7 +226,7 @@ function renderQueue(playNextAt, now)
|
|||||||
+ '</td><td class="hidden-xs plays-at" style="text-align: right;">' + showTime
|
+ '</td><td class="hidden-xs plays-at" style="text-align: right;">' + showTime
|
||||||
+ '</td><td>' + '<a href="#" class="glyphicon glyphicon-arrow-up'
|
+ '</td><td>' + '<a href="#" class="glyphicon glyphicon-arrow-up'
|
||||||
+ (canMoveUp && id !== 0 ? '' : ' invisible')
|
+ (canMoveUp && id !== 0 ? '' : ' invisible')
|
||||||
+ '" onclick=" return moveDown(' + prevId
|
+ '" onclick=" return moveDown(' + prevItem
|
||||||
+ ')"></a> <a href="#" class="glyphicon glyphicon-arrow-down'
|
+ ')"></a> <a href="#" class="glyphicon glyphicon-arrow-down'
|
||||||
+ (canMoveDown ? '' : ' invisible') + '" onclick="return moveDown('
|
+ (canMoveDown ? '' : ' invisible') + '" onclick="return moveDown('
|
||||||
+ song.id + ')"></a> <a href="#" class="glyphicon glyphicon-trash'
|
+ song.id + ')"></a> <a href="#" class="glyphicon glyphicon-trash'
|
||||||
|
|||||||
Reference in New Issue
Block a user