From 87ed3301e8559518188c568723fba3adb0429d51 Mon Sep 17 00:00:00 2001 From: Jim Driessen Date: Mon, 30 Jan 2017 16:55:45 +0100 Subject: [PATCH] Prevent scrolling to top for volume control. --- marietje/marietje/static/js/queue.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/marietje/marietje/static/js/queue.js b/marietje/marietje/static/js/queue.js index a4d5099..c8c3153 100644 --- a/marietje/marietje/static/js/queue.js +++ b/marietje/marietje/static/js/queue.js @@ -73,11 +73,13 @@ $(function () { getSongs(); }); - $('#volume-down').click(function(){ + $('#volume-down').click(function(e){ + e.preventDefault(); $.post('/api/volumedown', {csrfmiddlewaretoken: csrf_token}); }); - $('#volume-up').click(function(){ + $('#volume-up').click(function(e){ + e.preventDefault(); $.post('/api/volumeup', {csrfmiddlewaretoken: csrf_token}); });