mirror of
https://github.com/NicolasConstant/sengi
synced 2025-01-21 13:20:48 +01:00
added privacy changes context-menu binding
This commit is contained in:
parent
a33a01289a
commit
893fb73363
@ -34,23 +34,26 @@
|
||||
<fa-icon [icon]="faPaperclip"></fa-icon>
|
||||
</a>
|
||||
<a href class="status-editor__footer--link" title="adjust status privacy" (click)="onContextMenu($event)">
|
||||
<fa-icon [icon]="faGlobeAmericas"></fa-icon>
|
||||
<fa-icon [icon]="faGlobeAmericas" *ngIf="selectedPrivacy === 'Public'"></fa-icon>
|
||||
<fa-icon [icon]="faLockOpen" *ngIf="selectedPrivacy === 'Unlisted'"></fa-icon>
|
||||
<fa-icon [icon]="faLock" *ngIf="selectedPrivacy === 'Follows-only'"></fa-icon>
|
||||
<fa-icon [icon]="faEnvelope" *ngIf="selectedPrivacy === 'DM'"></fa-icon>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="status-form__mention-error" *ngIf="mentionTooFarAwayError">Error: mentions must be placed closer to the start in order to use multiposting.</div>
|
||||
|
||||
<context-menu #contextMenu>
|
||||
<ng-template contextMenuItem (execute)="changePrivacy()">
|
||||
<ng-template contextMenuItem (execute)="changePrivacy('Public')">
|
||||
<fa-icon [icon]="faGlobeAmericas"></fa-icon> Public
|
||||
</ng-template>
|
||||
<ng-template contextMenuItem (execute)="changePrivacy()">
|
||||
<ng-template contextMenuItem (execute)="changePrivacy('Unlisted')">
|
||||
<fa-icon [icon]="faLockOpen"></fa-icon> Unlisted
|
||||
</ng-template>
|
||||
<ng-template contextMenuItem (execute)="changePrivacy()">
|
||||
<ng-template contextMenuItem (execute)="changePrivacy('Follows-only')">
|
||||
<fa-icon [icon]="faLock"></fa-icon> Followers-only
|
||||
</ng-template>
|
||||
<ng-template contextMenuItem (execute)="changePrivacy()">
|
||||
<ng-template contextMenuItem (execute)="changePrivacy('DM')">
|
||||
<fa-icon [icon]="faEnvelope"></fa-icon> Direct
|
||||
</ng-template>
|
||||
</context-menu>
|
||||
|
@ -134,7 +134,7 @@ export class CreateStatusComponent implements OnInit, OnDestroy {
|
||||
private statusReplyingTo: Status;
|
||||
|
||||
selectedPrivacy = 'Public';
|
||||
privacyList: string[] = ['Public', 'Unlisted', 'Follows-only', 'DM'];
|
||||
// privacyList: string[] = ['Public', 'Unlisted', 'Follows-only', 'DM'];
|
||||
|
||||
private accounts$: Observable<AccountInfo[]>;
|
||||
private accountSub: Subscription;
|
||||
@ -185,6 +185,11 @@ export class CreateStatusComponent implements OnInit, OnDestroy {
|
||||
this.accountSub.unsubscribe();
|
||||
}
|
||||
|
||||
changePrivacy(value: string): boolean {
|
||||
this.selectedPrivacy = value;
|
||||
return false;
|
||||
}
|
||||
|
||||
private detectAutosuggestion(status: string) {
|
||||
if (!this.loaded) return;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user