mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
save
This commit is contained in:
@@ -98,6 +98,22 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<ion-fab horizontal="end" vertical="bottom" slot="fixed">
|
||||
<ion-fab-button *ngIf="scrollToBottomBtn" (click)="scrollToBottomClicked()" color="light" size="small">
|
||||
<ion-icon name="chevron-down"></ion-icon>
|
||||
</ion-fab-button>
|
||||
<!-- <ion-fab-list side="start">
|
||||
<ion-fab-button color="light">
|
||||
<ion-icon name="chevron-down"></ion-icon>
|
||||
</ion-fab-button>
|
||||
<ion-fab-button color="light">
|
||||
<ion-icon name="logo-twitter"></ion-icon>
|
||||
</ion-fab-button>
|
||||
<ion-fab-button color="light">
|
||||
<ion-icon name="logo-vimeo"></ion-icon>
|
||||
</ion-fab-button>
|
||||
</ion-fab-list> -->
|
||||
</ion-fab>
|
||||
|
||||
</ion-content>
|
||||
|
||||
|
||||
@@ -54,6 +54,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
private scrollChangeCallback: () => void;
|
||||
currentPosition: any;
|
||||
startPosition: number;
|
||||
scrollToBottomBtn = false;
|
||||
|
||||
@Input() roomId:string;
|
||||
@Output() closeAllDesktopComponents:EventEmitter<any> = new EventEmitter<any>();
|
||||
@@ -158,20 +159,35 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
} catch(err) { }
|
||||
}
|
||||
|
||||
scrollToBottomClicked(): void {
|
||||
try {
|
||||
this.myScrollContainer.nativeElement.scrollTop = this.myScrollContainer.nativeElement.scrollHeight;
|
||||
} catch(err) { }
|
||||
}
|
||||
|
||||
ngAfterViewInit() {
|
||||
this.scrollChangeCallback = () => this.onContentScrolled(event);
|
||||
window.addEventListener('scroll', this.scrollChangeCallback, true);
|
||||
}
|
||||
|
||||
onContentScrolled(e) {
|
||||
onContentScrolled(e) {
|
||||
this.startPosition = e.srcElement.scrollTop;
|
||||
let scroll = e.srcElement.scrollTop;
|
||||
let windowHeight = e.srcElement.scrollHeight;
|
||||
let containerHeight = windowHeight - 454.199951171875;
|
||||
|
||||
if (scroll > this.currentPosition) {
|
||||
//this.showButton = false;
|
||||
//alert('BOTTOM');
|
||||
} else {
|
||||
//this.showButton = true;
|
||||
//alert('UP');
|
||||
this.scrollingOnce = false;
|
||||
}
|
||||
if((containerHeight - 100) > scroll){
|
||||
this.scrollToBottomBtn = true;
|
||||
}
|
||||
else{
|
||||
this.scrollToBottomBtn = false;
|
||||
}
|
||||
this.currentPosition = scroll;
|
||||
}
|
||||
|
||||
|
||||
@@ -31,8 +31,18 @@
|
||||
</ion-refresher-content>
|
||||
</ion-refresher>
|
||||
<div class="messages" #scrollMe>
|
||||
<div class="container-width-100" *ngFor="let msg of chatMessageStore.message[roomId]; let last = last">
|
||||
<div class='incoming-{{msg.u.username!=loggedUser.me.username}} max-width-45'>
|
||||
<div class="messages-list-item-wrapper container-width-100" *ngFor="let msg of chatMessageStore.message[roomId]; let last = last">
|
||||
<div class='message-item incoming-{{msg.u.username!=loggedUser.me.username}} max-width-45'>
|
||||
<div class="message-item-options d-flex justify-content-end">
|
||||
<fa-icon (click)="mesageItemDropdownOptions=true" icon="chevron-down" class="message-options-icon"></fa-icon>
|
||||
<!-- <div class="mesage-item-dropdown-options" *ngIf="mesageItemDropdownOptions">
|
||||
<ion-label>Apagar mensagem</ion-label>
|
||||
</div> -->
|
||||
<ion-select hidden class="message-options-icon" interface="popover">
|
||||
<ion-select-option value="nes">Apagar mensagem</ion-select-option>
|
||||
</ion-select>
|
||||
|
||||
</div>
|
||||
<div class="title">
|
||||
<ion-label>{{msg.u.name}}</ion-label>
|
||||
<span class="time">{{showDateDuration(msg._updatedAt)}}</span>
|
||||
@@ -69,6 +79,22 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<ion-fab horizontal="end" vertical="bottom" slot="fixed">
|
||||
<ion-fab-button *ngIf="scrollToBottomBtn" (click)="scrollToBottomClicked()" color="light" size="small">
|
||||
<ion-icon name="chevron-down"></ion-icon>
|
||||
</ion-fab-button>
|
||||
<!-- <ion-fab-list side="start">
|
||||
<ion-fab-button color="light">
|
||||
<ion-icon name="chevron-down"></ion-icon>
|
||||
</ion-fab-button>
|
||||
<ion-fab-button color="light">
|
||||
<ion-icon name="logo-twitter"></ion-icon>
|
||||
</ion-fab-button>
|
||||
<ion-fab-button color="light">
|
||||
<ion-icon name="logo-vimeo"></ion-icon>
|
||||
</ion-fab-button>
|
||||
</ion-fab-list> -->
|
||||
</ion-fab>
|
||||
|
||||
</ion-content>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user