mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-07 20:40:26 +08:00
Merge pull request #8541 from aignatov-bio/ai-sci-11779-fix-comment-sidebar-size-on-mobile-devices
Fix sidebar size on mobile devices [SCI-11779]
This commit is contained in:
commit
a11a38fd6c
1 changed files with 9 additions and 0 deletions
|
@ -25,6 +25,11 @@ var CommentsSidebar = (function() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setCommentSidebarHeight() {
|
||||||
|
const sidebarHeight = visualViewport.height - 72;
|
||||||
|
$(SIDEBAR).css('height', `${sidebarHeight}px`);
|
||||||
|
}
|
||||||
|
|
||||||
function updateCounter() {
|
function updateCounter() {
|
||||||
var commentsAmount = $(SIDEBAR).find('.comments-list .comment-container').length;
|
var commentsAmount = $(SIDEBAR).find('.comments-list .comment-container').length;
|
||||||
if (commentsCounter.length) {
|
if (commentsCounter.length) {
|
||||||
|
@ -175,9 +180,13 @@ var CommentsSidebar = (function() {
|
||||||
$(SIDEBAR).addClass('open loading');
|
$(SIDEBAR).addClass('open loading');
|
||||||
initInputField();
|
initInputField();
|
||||||
loadCommentsList();
|
loadCommentsList();
|
||||||
|
window.addEventListener('resize', setCommentSidebarHeight);
|
||||||
|
window.addEventListener('scroll', setCommentSidebarHeight);
|
||||||
},
|
},
|
||||||
close: function() {
|
close: function() {
|
||||||
$(SIDEBAR).removeClass('open');
|
$(SIDEBAR).removeClass('open');
|
||||||
|
window.removeEventListener('resize', setCommentSidebarHeight);
|
||||||
|
window.removeEventListener('scroll', setCommentSidebarHeight);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}());
|
}());
|
||||||
|
|
Loading…
Add table
Reference in a new issue