MOBILE-3814 messages: Fix fab button styles with badge
parent
c4bf0438f9
commit
494382921f
|
@ -129,8 +129,8 @@
|
||||||
[attr.aria-label]="'addon.messages.newmessages' | translate">
|
[attr.aria-label]="'addon.messages.newmessages' | translate">
|
||||||
<ion-icon name="fas-arrow-down" aria-hidden="true"></ion-icon>
|
<ion-icon name="fas-arrow-down" aria-hidden="true"></ion-icon>
|
||||||
<span class="sr-only">{{ 'addon.messages.newmessages' | translate }}</span>
|
<span class="sr-only">{{ 'addon.messages.newmessages' | translate }}</span>
|
||||||
<ion-badge class="core-discussion-messages-badge">{{ newMessages }}</ion-badge>
|
|
||||||
</ion-fab-button>
|
</ion-fab-button>
|
||||||
|
<ion-badge class="core-discussion-messages-badge">{{ newMessages }}</ion-badge>
|
||||||
</ion-fab>
|
</ion-fab>
|
||||||
</ion-content>
|
</ion-content>
|
||||||
<ion-footer class="footer-adjustable" *ngIf="loaded && (!conversationId || conversation)">
|
<ion-footer class="footer-adjustable" *ngIf="loaded && (!conversationId || conversation)">
|
||||||
|
|
|
@ -1092,8 +1092,8 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView
|
||||||
// Leave time for the view to be rendered.
|
// Leave time for the view to be rendered.
|
||||||
await CoreUtils.nextTicks(5);
|
await CoreUtils.nextTicks(5);
|
||||||
|
|
||||||
if (!this.viewDestroyed) {
|
if (!this.viewDestroyed && this.content) {
|
||||||
this.content!.scrollToBottom(0);
|
this.content.scrollToBottom(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (force) {
|
if (force) {
|
||||||
|
@ -1106,10 +1106,10 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView
|
||||||
* Scroll to the first new unread message.
|
* Scroll to the first new unread message.
|
||||||
*/
|
*/
|
||||||
scrollToFirstUnreadMessage(): void {
|
scrollToFirstUnreadMessage(): void {
|
||||||
if (this.newMessages > 0) {
|
if (this.newMessages > 0 && this.content) {
|
||||||
const messages = Array.from(this.hostElement.querySelectorAll('.addon-message-not-mine'));
|
const messages = Array.from(this.hostElement.querySelectorAll('.addon-message-not-mine'));
|
||||||
|
|
||||||
CoreDomUtils.scrollToElement(this.content!, <HTMLElement> messages[messages.length - this.newMessages]);
|
CoreDomUtils.scrollToElement(this.content, <HTMLElement> messages[messages.length - this.newMessages]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,19 +19,12 @@
|
||||||
padding-bottom: 0;
|
padding-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
ion-fab ion-fab-button {
|
ion-fab .core-discussion-messages-badge {
|
||||||
&::part(native) {
|
position: absolute;
|
||||||
contain: unset;
|
color: var(--addon-messages-discussion-badge-text);
|
||||||
overflow: visible;
|
background-color: var(--addon-messages-discussion-badge);
|
||||||
}
|
display: block;
|
||||||
|
@include position(0, 0, null, null);
|
||||||
.core-discussion-messages-badge {
|
|
||||||
position: absolute;
|
|
||||||
color: var(--addon-messages-discussion-badge-text);
|
|
||||||
background-color: var(--addon-messages-discussion-badge);
|
|
||||||
display: block;
|
|
||||||
@include position(-6px, -6px, null, null);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ion-header ion-toolbar h1 {
|
ion-header ion-toolbar h1 {
|
||||||
|
|
Loading…
Reference in New Issue