From 09a733ca47c1d330ecfb6d188f895ba26f352f61 Mon Sep 17 00:00:00 2001 From: Sebastien Date: Tue, 18 Sep 2018 10:02:16 +0300 Subject: [PATCH] Change add methods --- src/main/resources/static/js/music.js | 24 ++++++--------------- src/main/resources/templates/music.html | 28 ++++++++++++++++++++++--- 2 files changed, 31 insertions(+), 21 deletions(-) diff --git a/src/main/resources/static/js/music.js b/src/main/resources/static/js/music.js index b3e2526..fb9b23c 100644 --- a/src/main/resources/static/js/music.js +++ b/src/main/resources/static/js/music.js @@ -27,6 +27,7 @@ $(document).ready(function() { btn_add = $('#add_btn'); switchAutoFlow = $("#autoflow"); + $('.tooltipped').tooltip(); setInterval("getCurentMusic()", 1000); $('#modalAdd').modal(); @@ -398,12 +399,10 @@ function listeners() { $('#input_link').on("input", function () { if($('#input_link').val() == ""){ - disableBtn($('#btn_add_bottom')); - disableBtn($('#btn_add_top')); + disableBtn($('#btn_add')); } else{ - enableBtn($('#btn_add_bottom')); - enableBtn($('#btn_add_top')); + enableBtn($('#btn_add')); } }); @@ -420,24 +419,13 @@ function listeners() { sendCommand(command); }); - $('#btn_add_top').click(function () { + $('#btn_add').click(function () { + console.log(!$('#bottom').is(':checked')); var command = { command: "ADD", url: $('#input_link').val(), playlistLimit: $('#limit_range').val(), - onHead: true - }; - $('#input_link').val(''); - sendCommand(command); - }); - - $('#btn_add_bottom').click(function () { - - var command = { - command: "ADD", - url: $('#input_link').val(), - playlistLimit: $('#limit_range').val(), - onHead: false + onHead: !$('#bottom').is(':checked') }; $('#input_link').val(''); sendCommand(command); diff --git a/src/main/resources/templates/music.html b/src/main/resources/templates/music.html index 7706f4a..3584b46 100644 --- a/src/main/resources/templates/music.html +++ b/src/main/resources/templates/music.html @@ -88,7 +88,7 @@ add_circle_outline -