mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-06 20:05:55 +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() {
|
||||
var commentsAmount = $(SIDEBAR).find('.comments-list .comment-container').length;
|
||||
if (commentsCounter.length) {
|
||||
|
@ -175,9 +180,13 @@ var CommentsSidebar = (function() {
|
|||
$(SIDEBAR).addClass('open loading');
|
||||
initInputField();
|
||||
loadCommentsList();
|
||||
window.addEventListener('resize', setCommentSidebarHeight);
|
||||
window.addEventListener('scroll', setCommentSidebarHeight);
|
||||
},
|
||||
close: function() {
|
||||
$(SIDEBAR).removeClass('open');
|
||||
window.removeEventListener('resize', setCommentSidebarHeight);
|
||||
window.removeEventListener('scroll', setCommentSidebarHeight);
|
||||
}
|
||||
};
|
||||
}());
|
||||
|
|
Loading…
Add table
Reference in a new issue