Skip to content

Commit 9d772ef

Browse files
committed
Add music fix
1 parent b654f6c commit 9d772ef

3 files changed

Lines changed: 11 additions & 5 deletions

File tree

dist/APlayer.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/APlayer.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/APlayer.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -940,10 +940,16 @@ class APlayer {
940940
this.element.classList.add('aplayer-withlist');
941941
this.audio.loop = false;
942942
}
943+
var songListLength = listEle.getElementsByTagName('li').length;
943944

944-
list.style.height = 'auto';
945-
list.style.height = list.offsetHeight + 'px';
946-
945+
if(list.classList.contains('aplayer-list-hide')) {
946+
list.style.height = (songListLength * 32.75) + 'px';
947+
}
948+
else {
949+
list.style.height = 'auto';
950+
list.style.height = list.offsetHeight + 'px';
951+
}
952+
947953
this.getRandomOrder();
948954
}
949955
}

0 commit comments

Comments
 (0)