Merge pull request #4227 from aignatov-bio/ai-sci-6971-fix-step-comments

Fix step comments [SCI-6971]
This commit is contained in:
aignatov-bio 2022-07-15 10:10:56 +02:00 committed by GitHub
commit 63c54d9005
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 1 deletions

View file

@ -52,6 +52,7 @@ var CommentsSidebar = (function() {
$(document).on('click', `${SIDEBAR} .scroll-page-with-anchor`, function(e) {
e.preventDefault();
$($(this).attr('href'))[0].scrollIntoView();
window.scrollBy(0, -130);
});
}

View file

@ -35,6 +35,7 @@
.comments-subject-title {
@include font-h3;
flex-basis: calc(100% - 36px);
flex-grow: 1;
height: 2em;
line-height: 2em;
@ -211,7 +212,9 @@
justify-content: flex-end;
.user-avatar {
border-radius: 50%;
order: 3;
overflow: hidden;
}
}
}

View file

@ -89,7 +89,7 @@
class="open-comments-sidebar btn icon-btn btn-light"
data-turbolinks="false"
data-object-type="Step"
@click="showCommentsSidebar = true"
@click="openCommentsSidebar"
:data-object-id="step.id">
<i class="fas fa-comment"></i>
<span class="comments-counter"
@ -236,6 +236,7 @@
},
mounted() {
$(this.$refs.comments).data('closeCallback', this.closeCommentsSidebar);
$(this.$refs.comments).data('openCallback', this.closeCommentsSidebar);
$(this.$refs.actionsDropdownButton).on('shown.bs.dropdown hidden.bs.dropdown', this.handleDropdownPosition);
},
computed: {
@ -373,6 +374,10 @@
addAttachment(attachment) {
this.attachments.push(attachment);
},
openCommentsSidebar() {
$('.comments-sidebar .close-btn').click();
this.showCommentsSidebar = true
},
closeCommentsSidebar() {
this.showCommentsSidebar = false
},