added datebinding to presentation text in profil

This commit is contained in:
Nicolas Constant 2018-10-31 23:47:38 -04:00
parent 7aff805570
commit 4f02759204
No known key found for this signature in database
GPG Key ID: 1E9F677FB01A5688
7 changed files with 28 additions and 6 deletions

View File

@ -1 +1 @@
<div #content class="content" innerHTML="{{processedText}}" (click)="selectText()"></div>
<div #content class="content" [class.selectable]="textIsSelectable" innerHTML="{{processedText}}" (click)="selectText()"></div>

View File

@ -1,6 +1,6 @@
@import "variables";
.content {
.selectable {
cursor: pointer;
}

View File

@ -18,6 +18,8 @@ export class DatabindedTextComponent implements OnInit {
@Output() hashtagSelected = new EventEmitter<string>();
@Output() textSelected = new EventEmitter();
@Input() textIsSelectable: boolean = true;
@Input('text')
set text(value: string) {
this.processedText = '';

View File

@ -11,7 +11,7 @@
<app-waiting-animation *ngIf="isLoading" class="waiting-icon"></app-waiting-animation>
<app-user-profile *ngIf="account" [currentAccount]="account"></app-user-profile>
<app-user-profile *ngIf="account" [currentAccount]="account" (browseAccount)="accountSelected($event)" (browseHashtag)="hashtagSelected($event)"></app-user-profile>
<app-hashtag *ngIf="browseHashtag"></app-hashtag>
<app-thread *ngIf="browseThread"></app-thread>
</div>

View File

@ -25,7 +25,7 @@ export class StreamOverlayComponent implements OnInit {
@Input('browseAccount')
set browseAccount(accountName: string) {
this.accountName = accountName;
this.loadAccount(accountName);
// let selectedAccounts = this.toolsService.getSelectedAccounts();
@ -79,7 +79,16 @@ export class StreamOverlayComponent implements OnInit {
return false;
}
accountSelected(accountName: string): void {
this.loadAccount(accountName);
}
hashtagSelected(hashtag: string): void {
}
private loadAccount(accountName: string): void {
this.account = null;
this.accountName = accountName;
let selectedAccounts = this.toolsService.getSelectedAccounts();
if (selectedAccounts.length === 0) {

View File

@ -5,5 +5,6 @@
<h2 class="profile-header__fullhandle">@{{account.acct}}</h2>
</div>
<div class="profile-description" *ngIf="hasNote">
<p innerHTML="{{account.note}}"></p>
<app-databinded-text class="status__content" [textIsSelectable]="false" [text]="account.note" (accountSelected)="accountSelected($event)" (hashtagSelected)="hashtagSelected($event)" ></app-databinded-text>
<!-- <p innerHTML="{{account.note}}"></p> -->
</div>

View File

@ -1,4 +1,4 @@
import { Component, OnInit, Input } from '@angular/core';
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
import { Account } from "../../../services/models/mastodon.interfaces";
@Component({
@ -10,6 +10,9 @@ export class UserProfileComponent implements OnInit {
account: Account;
hasNote: boolean;
@Output() browseAccount = new EventEmitter<string>();
@Output() browseHashtag = new EventEmitter<string>();
@Input('currentAccount')
set currentAccount(account: Account) {
this.account = account;
@ -23,4 +26,11 @@ export class UserProfileComponent implements OnInit {
ngOnInit() {
}
accountSelected(accountName: string): void {
this.browseAccount.next(accountName);
}
hashtagSelected(hashtag: string): void {
this.browseHashtag.next(hashtag);
}
}