button removal, fix CWs removal

This commit is contained in:
Nicolas Constant 2019-09-28 15:12:16 -04:00
parent 41b3c83af6
commit 6409a06970
No known key found for this signature in database
GPG Key ID: 1E9F677FB01A5688
3 changed files with 53 additions and 36 deletions

View File

@ -1,19 +1,20 @@
<div class="stream-toots flexcroll" #statusstream (scroll)="onScroll()">
<div class="stream-toots">
<div class="stream-toots__remove-cw" *ngIf="isThread && hasContentWarnings">
<button class="stream-toots__remove-cw--button" (click)="removeCw()"
title="remove content warnings">Remove CWs</button>
</div>
<div *ngIf="displayError" class="stream-toots__error">{{displayError}}</div>
<!-- data-simplebar -->
<div class="stream-toots__status" *ngFor="let statusWrapper of statuses" #status>
<app-status
[statusWrapper]="statusWrapper"
[isThreadDisplay]="isThread"
(browseAccountEvent)="browseAccount($event)"
(browseHashtagEvent)="browseHashtag($event)"
(browseThreadEvent)="browseThread($event)"></app-status>
<a href class="stream-toots__remove-cw--button" (click)="removeCw()" title="remove content warnings">
Remove CWs
</a>
</div>
<app-waiting-animation *ngIf="isLoading" class="waiting-icon"></app-waiting-animation>
<div class="stream-toots__content flexcroll" #statusstream (scroll)="onScroll()">
<div *ngIf="displayError" class="stream-toots__error">{{displayError}}</div>
<!-- data-simplebar -->
<div class="stream-toots__status" *ngFor="let statusWrapper of statuses" #status>
<app-status [statusWrapper]="statusWrapper" [isThreadDisplay]="isThread"
(browseAccountEvent)="browseAccount($event)" (browseHashtagEvent)="browseHashtag($event)"
(browseThreadEvent)="browseThread($event)"></app-status>
</div>
<app-waiting-animation *ngIf="isLoading" class="waiting-icon"></app-waiting-animation>
</div>
</div>

View File

@ -4,45 +4,60 @@
.stream-toots {
height: calc(100%);
width: calc(100%);
overflow: auto;
// overflow: auto;
position: relative;
&__error {
padding: 20px 20px 0 20px;
color: rgb(255, 113, 113);
}
&__content {
height: calc(100%);
overflow: auto;
}
&__status:not(:last-child) {
border: solid #06070b;
border-width: 0 0 1px 0;
}
&__remove-cw {
&__remove-cw {
z-index: 100;
position: absolute;
top: 10px;
right: 20px;
padding: 5px;
// border: solid #06070b;
// border-width: 0 0 1px 0;
height: 45px;
// width: calc(100%);
// position: relative;
&--button {
@include clearButton;
&--button {
// position: absolute;
// width: calc(80%);
// margin-left: 40%;
// transform: translateX(-40%);
width: calc(100%);
padding: 5px 0;
z-index: 10;
text-align: center;
border: 3px $status-secondary-color double;
transition: all .2s;
text-decoration: none;
padding: 5px 5px;
padding: 5px 10px;
text-align: center;
border: 3px $status-secondary-color double;
border: 0;
background-color: $color-secondary;
background-color: $status-secondary-color;
// background-color: rgb(238, 238, 238);
color: white;
&:hover{
$hover-color: $status-secondary-color;
background-color: $hover-color;
color: white;
border: 3px $hover-color double;
background-color: $status-secondary-color;
background-color: rgb(238, 238, 238);
color: black;
//border: 3px $hover-color double;
}
}
}

View File

@ -214,11 +214,12 @@ export class ThreadComponent implements OnInit, OnDestroy {
this.browseThreadEvent.next(openThreadEvent);
}
removeCw() {
removeCw(): boolean {
const statuses = this.statusChildren.toArray();
statuses.forEach(x => {
x.removeContentWarning();
});
this.hasContentWarnings = false;
return false;
}
}