From 489f3f1d6f277034e3033fb194f222a8979f8604 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B6=B5=E6=9B=A6?= Date: Thu, 1 Aug 2024 23:21:31 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20#131=20=E4=BF=AE=E5=A4=8D=E5=A4=9A?= =?UTF-8?q?=E8=AE=BE=E5=A4=87=E5=88=87=E6=8D=A2=E6=97=B6=E6=92=AD=E6=94=BE?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E6=98=BE=E7=A4=BA=E9=94=99=E8=AF=AF=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- xiaomusic/static/app.js | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/xiaomusic/static/app.js b/xiaomusic/static/app.js index 739eaca..babfb56 100644 --- a/xiaomusic/static/app.js +++ b/xiaomusic/static/app.js @@ -53,15 +53,17 @@ $(function(){ .prop('selected', value === did); $("#did").append(option); - if (cur_device.play_type == PLAY_TYPE_ALL) { - $("#play_type_all").css('background-color', '#b1a8f3'); - $("#play_type_all").text('✔️ 全部循环'); - } else if (cur_device.play_type == PLAY_TYPE_ONE) { - $("#play_type_one").css('background-color', '#b1a8f3'); - $("#play_type_one").text('✔️ 单曲循环'); - } else if (cur_device.play_type == PLAY_TYPE_RND) { - $("#play_type_rnd").css('background-color', '#b1a8f3'); - $("#play_type_rnd").text('✔️ 随机播放'); + if (value === did) { + if (cur_device.play_type == PLAY_TYPE_ALL) { + $("#play_type_all").css('background-color', '#b1a8f3'); + $("#play_type_all").text('✔️ 全部循环'); + } else if (cur_device.play_type == PLAY_TYPE_ONE) { + $("#play_type_one").css('background-color', '#b1a8f3'); + $("#play_type_one").text('✔️ 单曲循环'); + } else if (cur_device.play_type == PLAY_TYPE_RND) { + $("#play_type_rnd").css('background-color', '#b1a8f3'); + $("#play_type_rnd").text('✔️ 随机播放'); + } } } }); @@ -72,6 +74,7 @@ $(function(){ localStorage.setItem('cur_did', did); window.did = did; console.log('cur_did', did); + location.reload(); }) });