From 2685a3c9cc3c976e441660c26b8612de6f9d8497 Mon Sep 17 00:00:00 2001 From: Jim Driessen Date: Thu, 2 Feb 2017 15:20:02 +0100 Subject: [PATCH] Display mobile info box at the correct position. --- marietje/marietje/static/js/queue.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/marietje/marietje/static/js/queue.js b/marietje/marietje/static/js/queue.js index 554b31a..f4a75b3 100644 --- a/marietje/marietje/static/js/queue.js +++ b/marietje/marietje/static/js/queue.js @@ -87,6 +87,8 @@ $(function () { }); $(document).on('touchstart', '.artist, .title', function(){ + noRemove = true; + setTimeout(function(){ noRemove = false; }, 500); $('.song-info').remove(); var row = $(this).parent(); var timeLeft = row.find('.time-left'); @@ -95,12 +97,14 @@ $(function () { $('body').append('Requested By: ' + row.find('.requested-by').text() + '
' + text + '
'); var offset = row.offset(); - $('.song-info').css('top', offset.top - $(document).scrollTop() + row.height()) + $('.song-info').css('top', offset.top + row.height()) .css('left', offset.left).css('backgroundColor', '#EEEEEE').width(row.width() - 16); }); - $(document).on('click', '.song-info', function(){ - $(this).remove(); + $(document).on('click', function(){ + if(!noRemove) { + $('.song-info').remove(); + } }); getSongs();