-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3527 from IgniteUI/vnext
Merging vnext to master to add latest fixes
- Loading branch information
Showing
15 changed files
with
224 additions
and
252 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
134 changes: 90 additions & 44 deletions
134
src/app/lists/list/list-chat-sample/list-chat-sample.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,99 @@ | ||
<div class="chat-sample-wrapper"> | ||
<form class="chat-sample__form"> | ||
<igx-list #list> | ||
<ng-template #othersMessage let-message="message" let-contact="contact" let-messageIndex="index"> | ||
<igx-list-item class="contact" *ngIf="isFirstMessage(messageIndex)"> | ||
<div class="contact__panel"> | ||
<igx-avatar [src]="contact.photo" shape="circle"></igx-avatar> | ||
<span class="message__info"> | ||
{{ contact.name }}, {{ message.timestamp | date: 'shortTime'}} | ||
<form #form class="sample-form"> | ||
<igx-list #list> | ||
<ng-template | ||
#othersMessage | ||
let-message="message" | ||
let-contact="contact" | ||
let-messageIndex="index" | ||
> | ||
<igx-list-item class="contact" *ngIf="isFirstMessage(messageIndex)"> | ||
<section class="contact__panel"> | ||
<igx-avatar | ||
[src]="contact.photo" | ||
shape="circle" | ||
></igx-avatar> | ||
<header class="message__info"> | ||
<h6>{{ contact.name }}</h6> | ||
<span> | ||
{{ message.timestamp | date: "shortTime" }} | ||
</span> | ||
</div> | ||
</igx-list-item> | ||
<igx-list-item [ngClass]="{ | ||
'others-message': true, | ||
'others-message--first': isFirstMessage(messageIndex)}"> | ||
<span> | ||
{{ message.message }} | ||
</span> | ||
</igx-list-item> | ||
</ng-template> | ||
<ng-template #myMessage let-message="message" let-messageIndex="index"> | ||
<igx-list-item class="contact" *ngIf="isFirstMessage(messageIndex)"> | ||
<span class="my-message__info"> | ||
{{ message.timestamp | date: 'shortTime'}} | ||
</header> | ||
</section> | ||
</igx-list-item> | ||
<igx-list-item> | ||
<div | ||
[ngClass]="{ | ||
message: true, | ||
'other-message': true, | ||
'other-message--first': isFirstMessage(messageIndex) | ||
}" | ||
> | ||
<span>{{ message.message }}</span> | ||
</div> | ||
</igx-list-item> | ||
</ng-template> | ||
<ng-template #myMessage let-message="message" let-messageIndex="index"> | ||
<igx-list-item class="contact" *ngIf="isFirstMessage(messageIndex)"> | ||
<header class="own-message message__info"> | ||
<h6>You</h6> | ||
<span class="message__info"> | ||
{{ message.timestamp | date: "shortTime" }} | ||
</span> | ||
</igx-list-item> | ||
<igx-list-item class="my-message" [ngClass]="{ | ||
'my-message': true, | ||
'my-message--first': isFirstMessage(messageIndex)}"> | ||
</header> | ||
</igx-list-item> | ||
<igx-list-item> | ||
<div | ||
[ngClass]="{ | ||
message: true, | ||
'own-message': true, | ||
'own-message--first': isFirstMessage(messageIndex) | ||
}" | ||
> | ||
<span> | ||
{{ message.message }} | ||
</span> | ||
</igx-list-item> | ||
</ng-template> | ||
</div> | ||
</igx-list-item> | ||
</ng-template> | ||
|
||
<ng-container *ngFor="let message of messagesService.getMessages(); index as i"> | ||
<ng-container *ngTemplateOutlet="getMessageTemplate(message); context: {message: message, contact: contactsService.getContact(message.authorId), index: i}"> | ||
</ng-container> | ||
<ng-container | ||
*ngFor="let message of messagesService.getMessages(); index as i" | ||
> | ||
<ng-container | ||
*ngTemplateOutlet=" | ||
getMessageTemplate(message); | ||
context: { | ||
message: message, | ||
contact: contactsService.getContact(message.authorId), | ||
index: i | ||
} | ||
" | ||
> | ||
</ng-container> | ||
</igx-list> | ||
</ng-container> | ||
</igx-list> | ||
|
||
<div class="overflow-anchor"></div> | ||
|
||
<div class="massage-field"> | ||
<igx-input-group type="box"> | ||
<input | ||
#newMessage | ||
igxInput | ||
name="newMessage" | ||
placeholder="Send message" | ||
autocomplete="off" | ||
[(ngModel)]="message" | ||
(keypress)="onMessageKeypress($event)" | ||
/> | ||
|
||
<div class="chat-massage-field"> | ||
<igx-input-group class="chat-input-group" type="box"> | ||
<input class="input-round-box" placeholder="Send message" autocomplete="off" igxInput #newMessage name="newMessage" | ||
[(ngModel)]="message" (keypress)="onMessageKeypress($event)" /> | ||
</igx-input-group> | ||
<button class="send-message-button" igxIconButton="flat" | ||
igxRipple="#09f" [igxRippleCentered]="true" (click)="onSendButtonClick()"> | ||
<igx-icon family="material">send</igx-icon> | ||
<button | ||
igxSuffix | ||
igxIconButton="flat" | ||
(click)="onSendButtonClick()" | ||
> | ||
<igx-icon name="send" family="material"></igx-icon> | ||
</button> | ||
</div> | ||
</form> | ||
</div> | ||
</igx-input-group> | ||
</div> | ||
</form> |
Oops, something went wrong.