added Ctrl+Enter keybind

This commit is contained in:
Nicolas Constant 2018-09-26 00:53:09 -04:00
parent f2e9dc4ea1
commit f2ef6544a5
No known key found for this signature in database
GPG Key ID: 1E9F677FB01A5688
2 changed files with 7 additions and 2 deletions

View File

@ -6,8 +6,8 @@
<input [(ngModel)]="title" type="text" class="form-control form-control-sm" name="title" autocomplete="off"
placeholder="Title (optional)" />
<!-- <textarea rows="4" cols="50"> -->
<textarea [(ngModel)]="status" name="status" class="form-control form-control-sm" style="min-width: 100%" rows="5"
required placeholder="What's in your mind?"></textarea>
<textarea [(ngModel)]="status" name="status" class="form-control form-control-sm" style="min-width: 100%" rows="5" required placeholder="What's in your mind?" (keydown.control.enter)="onCtrlEnter()"></textarea>
<select class="form-control form-control-sm form-control--privacy" id="privacy" name="privacy" [(ngModel)]="selectedPrivacy">
<option *ngFor="let p of privacyList" [ngValue]="p">{{p}}</option>
</select>

View File

@ -67,4 +67,9 @@ export class AddNewStatusComponent implements OnInit {
var regAccounts = <AccountInfo[]>this.store.snapshot().registeredaccounts.accounts;
return regAccounts;
}
onCtrlEnter(): boolean {
this.onSubmit();
return false;
}
}