From 624af8e7512e7cdcb2c15800b143d8d775e77efc Mon Sep 17 00:00:00 2001 From: Dave Furrer Date: Fri, 11 Nov 2016 21:31:00 -0600 Subject: [PATCH] Fixing issue with random button on web page. --- src/main/webapp/js/soundboard.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/main/webapp/js/soundboard.js b/src/main/webapp/js/soundboard.js index 66bad3d..44f8610 100644 --- a/src/main/webapp/js/soundboard.js +++ b/src/main/webapp/js/soundboard.js @@ -89,6 +89,20 @@ $(document).ready(function() { } }); + $(".randomButton").click(function() { + var volume = $('#volume').slider("option", "value"); + $.ajax({ + url: "/soundsApi/volume?volume=" + volume, + method: 'POST' + }); + + var username = $(".userNameSelect option:selected").text(); + $.ajax({ + url: "/soundsApi/playRandom?username=" + username, + method: 'POST' + }); + }); + $("#volume").slider({ min: 0, max: 100,