testing pasting
This commit is contained in:
parent
fb79e53b96
commit
252313aac2
|
@ -1,4 +1,4 @@
|
||||||
<form class="status-editor" (ngSubmit)="onSubmit()" (paste)="onPaste($event)" >
|
<form class="status-editor" (ngSubmit)="onSubmit()">
|
||||||
<input [(ngModel)]="title" type="text" class="form-control form-control-sm status-editor__title" name="title"
|
<input [(ngModel)]="title" type="text" class="form-control form-control-sm status-editor__title" name="title"
|
||||||
autocomplete="off" placeholder="Title, Content Warning (optional)" title="title, content warning (optional)" dir="auto" />
|
autocomplete="off" placeholder="Title, Content Warning (optional)" title="title, content warning (optional)" dir="auto" />
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
||||||
<img class="status-editor__emoji--image" src="/assets/emoji/72x72/1f636.png">
|
<img class="status-editor__emoji--image" src="/assets/emoji/72x72/1f636.png">
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<textarea #reply [(ngModel)]="status" name="status" class="form-control form-control-sm status-editor__content"
|
<textarea #reply [(ngModel)]="status" name="status" class="form-control form-control-sm status-editor__content" (paste)="onPaste($event)"
|
||||||
rows="5" required title="content" placeholder="What's in your mind?" (keydown.control.enter)="onCtrlEnter()"
|
rows="5" required title="content" placeholder="What's in your mind?" (keydown.control.enter)="onCtrlEnter()"
|
||||||
(keydown)="handleKeyDown($event)" (blur)="statusTextEditorLostFocus()" dir="auto">
|
(keydown)="handleKeyDown($event)" (blur)="statusTextEditorLostFocus()" dir="auto">
|
||||||
</textarea>
|
</textarea>
|
||||||
|
|
|
@ -206,8 +206,25 @@ export class CreateStatusComponent implements OnInit, OnDestroy {
|
||||||
this.accountSub.unsubscribe();
|
this.accountSub.unsubscribe();
|
||||||
}
|
}
|
||||||
|
|
||||||
onPaste(ev: ClipboardEvent){
|
onPaste(e: ClipboardEvent ) {
|
||||||
console.warn(ev);
|
console.log(e);
|
||||||
|
|
||||||
|
// e.stopPropagation();
|
||||||
|
// e.preventDefault();
|
||||||
|
|
||||||
|
// console.warn(e);
|
||||||
|
|
||||||
|
// console.warn(ev.clipboardData.getData('image'));
|
||||||
|
// console.warn(ev.clipboardData.getData());
|
||||||
|
|
||||||
|
|
||||||
|
// navigator['clipboard'].readText().then(clipText => {
|
||||||
|
// console.log(clipText);
|
||||||
|
// });
|
||||||
|
|
||||||
|
|
||||||
|
// var items = (ev.clipboardData || ev.originalEvent.clipboardData).items;
|
||||||
|
// console.error(items);
|
||||||
}
|
}
|
||||||
|
|
||||||
changePrivacy(value: string): boolean {
|
changePrivacy(value: string): boolean {
|
||||||
|
@ -229,7 +246,7 @@ export class CreateStatusComponent implements OnInit, OnDestroy {
|
||||||
private detectAutosuggestion(status: string) {
|
private detectAutosuggestion(status: string) {
|
||||||
if (!this.statusLoaded) return;
|
if (!this.statusLoaded) return;
|
||||||
|
|
||||||
if(!status.includes('@') && !status.includes('#')){
|
if (!status.includes('@') && !status.includes('#')) {
|
||||||
this.autosuggestData = null;
|
this.autosuggestData = null;
|
||||||
this.hasSuggestions = false;
|
this.hasSuggestions = false;
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue