binding add media button
This commit is contained in:
parent
50d32888b2
commit
ed42426733
|
@ -29,9 +29,11 @@
|
|||
<div class="status-editor__footer__counter--count" title="chars left">{{charCountLeft}}</div>
|
||||
</div>
|
||||
|
||||
<a href class="status-editor__footer--link" title="add media">
|
||||
<a href class="status-editor__footer--link" title="add media" (click)="addMedia()">
|
||||
<fa-icon [icon]="faPaperclip"></fa-icon>
|
||||
</a>
|
||||
<input #fileInput type="file" id="file" style="display: none;" (change)="handleFileInput($event.target.files)">
|
||||
|
||||
<a href class="status-editor__footer--link" title="adjust status privacy" (click)="onContextMenu($event)">
|
||||
<fa-icon [icon]="faGlobeAmericas" *ngIf="selectedPrivacy === 'Public'"></fa-icon>
|
||||
<fa-icon [icon]="faLockOpen" *ngIf="selectedPrivacy === 'Unlisted'"></fa-icon>
|
||||
|
|
|
@ -105,6 +105,7 @@ export class CreateStatusComponent implements OnInit, OnDestroy {
|
|||
@Input() statusReplyingToWrapper: StatusWrapper;
|
||||
@Output() onClose = new EventEmitter();
|
||||
@ViewChild('reply') replyElement: ElementRef;
|
||||
@ViewChild('fileInput') fileInputElement: ElementRef;
|
||||
@ViewChild(ContextMenuComponent) public contextMenu: ContextMenuComponent;
|
||||
|
||||
private _isDirectMention: boolean;
|
||||
|
@ -190,6 +191,17 @@ export class CreateStatusComponent implements OnInit, OnDestroy {
|
|||
return false;
|
||||
}
|
||||
|
||||
addMedia(): boolean {
|
||||
this.fileInputElement.nativeElement.click();
|
||||
return false;
|
||||
}
|
||||
|
||||
handleFileInput(files: File[]): boolean {
|
||||
const acc = this.toolsService.getSelectedAccounts()[0];
|
||||
this.mediaService.uploadMedia(acc, files);
|
||||
return false;
|
||||
}
|
||||
|
||||
private detectAutosuggestion(status: string) {
|
||||
if (!this.loaded) return;
|
||||
|
||||
|
|
Loading…
Reference in New Issue