Add ^S save binding to editor; fix bullet point delete bug

This commit is contained in:
garrettmills 2020-02-14 11:24:51 -06:00
parent 9f361896ee
commit 407d26eb05
3 changed files with 10 additions and 3 deletions

View File

@ -127,7 +127,7 @@ export class HostComponent implements OnInit {
const newLines = []; const newLines = [];
this.liItems.toArray().forEach((elem, index) => { this.liItems.toArray().forEach((elem, index) => {
if ( index !== i ) { if ( index !== i ) {
newLines.push(elem.innerText ? elem.innerText.trim() : ''); newLines.push(elem.nativeElement.innerText ? elem.nativeElement.innerText.trim() : '');
} }
}); });

View File

@ -1,5 +1,5 @@
<ng-container> <ng-container>
<ion-header> <ion-header (keydown)="onEditorKeydown($event)">
<ion-toolbar> <ion-toolbar>
<ion-buttons slot="start"> <ion-buttons slot="start">
<ion-menu-toggle> <ion-menu-toggle>
@ -14,7 +14,7 @@
</ion-toolbar> </ion-toolbar>
</ion-header> </ion-header>
<ion-content> <ion-content (keydown)="onEditorKeydown($event)">
<ng-container> <ng-container>
<div class="editor-root ion-padding"> <div class="editor-root ion-padding">
<div <div

View File

@ -239,4 +239,11 @@ export class EditorPage implements OnInit {
await popover.present(); await popover.present();
} }
onEditorKeydown($event) {
if ( $event.key === 's' && $event.ctrlKey ) {
$event.preventDefault();
this.onSaveClick();
}
}
} }