Skip to content

Commit eb070db

Browse files
committed
feat: code by Trae: bookshelf
1 parent 31cc8fd commit eb070db

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

epub_browser/assets/library.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -744,6 +744,7 @@ body {
744744

745745
.bookshelf-body {
746746
flex: 1;
747+
min-height: 0;
747748
overflow-y: auto;
748749
padding: 20px;
749750
display: grid;

epub_browser/assets/library.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -778,6 +778,7 @@ function initBookshelf() {
778778
renderGroupContent(group, 'All');
779779

780780
groupModal.classList.add('active');
781+
document.body.style.overflow = 'hidden';
781782
}
782783

783784
// 渲染分组内容
@@ -1127,11 +1128,13 @@ function initBookshelf() {
11271128
currentTag = 'All';
11281129
renderBookshelf('All');
11291130
bookshelfModal.classList.add('active');
1131+
document.body.style.overflow = 'hidden';
11301132
});
11311133

11321134
// 关闭书架弹窗
11331135
bookshelfCloseBtn.addEventListener('click', function() {
11341136
bookshelfModal.classList.remove('active');
1137+
document.body.style.overflow = '';
11351138
});
11361139

11371140
// 关闭分组弹窗
@@ -1145,6 +1148,7 @@ function initBookshelf() {
11451148
bookshelfModal.addEventListener('click', function(e) {
11461149
if (e.target === bookshelfModal) {
11471150
bookshelfModal.classList.remove('active');
1151+
document.body.style.overflow = '';
11481152
}
11491153
});
11501154

0 commit comments

Comments
 (0)