fix scroll bar when folding list

This commit is contained in:
DIYgod
2018-03-12 22:56:33 +08:00
parent b5e8cd0bea
commit ed18fa77e2
6 changed files with 26 additions and 17 deletions
+1
View File
@@ -154,6 +154,7 @@ class Controller {
initMenuButton () {
this.player.template.list.style.height = 33 * this.player.options.audio.length - 1 + 'px';
this.player.template.listOl.style.height = 33 * this.player.options.audio.length - 1 + 'px';
this.player.template.menu.addEventListener('click', () => {
if (!this.player.template.list.classList.contains('aplayer-list-hide')) {
this.player.template.list.classList.add('aplayer-list-hide');
+2
View File
@@ -411,6 +411,7 @@ class APlayer {
}
const songListLength = this.container.querySelectorAll('.aplayer-list li').length;
this.template.list.style.height = songListLength * 33 - 1 + 'px';
this.template.listOl.style.height = songListLength * 33 - 1 + 'px';
this.randomOrder = utils.randomOrder(this.options.audio.length);
}
@@ -445,6 +446,7 @@ class APlayer {
this.container.classList.remove('aplayer-withlist');
}
this.template.list.style.height = parseInt(this.template.list.style.height, 10) - 33 + 'px';
this.template.listOl.style.height = parseInt(this.template.listOl.style.height, 10) - 33 + 'px';
}
}