Skip to content
This repository has been archived by the owner on May 5, 2022. It is now read-only.

go scroll down automatically when reply #1051

Merged
merged 1 commit into from
Mar 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/app/mail/mail-detail/mail-detail.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -568,13 +568,13 @@ <h5 class="ui-header-subtitle text-dark mb-0 mail-subject">
<div ngbDropdown placement="bottom-right" class="mailbox-dropdown msg-reply-dropdown dropdown-xs">
<button ngbDropdownToggle class="actions-btn actions-btn-sm msg-reply-btn" role="button" id="{{ childMail.id }}-messageReplyDropdownMenuButton"></button>
<div ngbDropdownMenu [attr.aria-labelledby]="childMail.id + '-messageReplyDropdownMenuButton'">
<a class="dropdown-item" (click)="onForward(childMail, childIndex, true)">
<a class="dropdown-item" (click)="onForward(childMail, childIndex, true); scrollTo(replyActions)">
{{ 'mail_detail.forward' | translate }}
</a>
<a class="dropdown-item" (click)="onReply(childMail, childIndex, true)">
<a class="dropdown-item" (click)="onReply(childMail, childIndex, true); scrollTo(replyActions)">
{{ 'mail_detail.reply' | translate }}
</a>
<a class="dropdown-item" *ngIf="childMail.cc.length || childMail.bcc.length || childMail.receiver.length > 1" (click)="onReplyAll(childMail, childIndex, true)">
<a class="dropdown-item" *ngIf="childMail.cc.length || childMail.bcc.length || childMail.receiver.length > 1" (click)="onReplyAll(childMail, childIndex, true); scrollTo(replyActions)">
{{ 'mail_detail.reply_all' | translate }}
</a>
<a class="dropdown-item" (click)="onPrint(childMail)">{{ 'mail_detail.print' | translate }}</a>
Expand Down Expand Up @@ -664,17 +664,17 @@ <h5 class="ui-header-subtitle text-dark mb-0 mail-subject">
<div class="ui-body ui-footer-sec" #replyActions *ngIf="!isPopupOpen && isPopupOpen !== null">
<div class="row" *ngIf="mailFolder !== mailFolderTypes.OUTBOX && !hasDraft">
<div class="col-12">
<button class="btn btn-user-action" (click)="onReply(mail, 0, false, true)" [disabled]="!decryptedContents[mail.id]">
<button class="btn btn-user-action" (click)="onReply(mail, 0, false, true); scrollTo(replyActions)" [disabled]="!decryptedContents[mail.id]">
<i class="icon icon-reply position-left"></i>
<span>{{ 'mail_detail.reply' | translate }}</span>
<img src="assets/images/icon-reply.svg" class="hidden-sm-up" />
</button>
<button class="btn btn-user-action" (click)="onReplyAll(mail, 0, false, true)" *ngIf="mail.cc.length || mail.bcc.length || mail.receiver.length > 1" [disabled]="!decryptedContents[mail.id]">
<button class="btn btn-user-action" (click)="onReplyAll(mail, 0, false, true); scrollTo(replyActions)" *ngIf="mail.cc.length || mail.bcc.length || mail.receiver.length > 1" [disabled]="!decryptedContents[mail.id]">
<i class="icon icon-reply position-left"></i>
<span>{{ 'mail_detail.reply_all' | translate }}</span>
<img src="assets/images/icon-reply-all.svg" class="hidden-sm-up" />
</button>
<button class="btn btn-user-action" (click)="onForward(mail, 0, false, true)" [disabled]="!decryptedContents[mail.id]">
<button class="btn btn-user-action" (click)="onForward(mail, 0, false, true); scrollTo(replyActions)" [disabled]="!decryptedContents[mail.id]">
<i class="icon icon-mail icon-lg position-left"></i>
<span>{{ 'mail_detail.forward' | translate }}</span>
<img src="assets/images/icon-mail.svg" class="hidden-sm-up" />
Expand Down
5 changes: 1 addition & 4 deletions src/app/mail/mail-detail/mail-detail.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1045,10 +1045,7 @@ export class MailDetailComponent implements OnInit, OnDestroy {
scrollTo(elementReference: any) {
if (elementReference) {
setTimeout(() => {
window.scrollTo({
top: elementReference.offsetTop,
behavior: 'smooth',
});
elementReference.scrollIntoView({ behavior: 'smooth' });
}, 100);
}
}
Expand Down