diff --git a/client/src/app/site/motions/components/motion-block-list/motion-block-list.component.html b/client/src/app/site/motions/components/motion-block-list/motion-block-list.component.html index 85c5a78b0..7dc9540f6 100644 --- a/client/src/app/site/motions/components/motion-block-list/motion-block-list.component.html +++ b/client/src/app/site/motions/components/motion-block-list/motion-block-list.component.html @@ -7,7 +7,8 @@ Create new motion block - + @@ -50,7 +51,7 @@ Save - Cancel + Cancel diff --git a/client/src/app/site/motions/components/motion-block-list/motion-block-list.component.ts b/client/src/app/site/motions/components/motion-block-list/motion-block-list.component.ts index 2c661cdd9..e466f3690 100644 --- a/client/src/app/site/motions/components/motion-block-list/motion-block-list.component.ts +++ b/client/src/app/site/motions/components/motion-block-list/motion-block-list.component.ts @@ -169,4 +169,26 @@ export class MotionBlockListComponent extends ListViewBaseComponent New statute paragraph - + @@ -39,7 +40,7 @@ Save - + Cancel @@ -53,7 +54,9 @@ {{ statuteParagraph.title }} - + Edit statute paragraph: @@ -85,7 +88,7 @@ mat-icon-button> edit - close diff --git a/client/src/app/site/motions/components/statute-paragraph-list/statute-paragraph-list.component.ts b/client/src/app/site/motions/components/statute-paragraph-list/statute-paragraph-list.component.ts index 1b63ecc25..04aefada6 100644 --- a/client/src/app/site/motions/components/statute-paragraph-list/statute-paragraph-list.component.ts +++ b/client/src/app/site/motions/components/statute-paragraph-list/statute-paragraph-list.component.ts @@ -155,4 +155,49 @@ export class StatuteParagraphListComponent extends BaseViewComponent implements public sortStatuteParagraphs(): void { console.log('Not yet implemented. Depends on other Features'); } + + /** + * clicking Shift and Enter will save automatically + * clicking Escape will cancel the process + * + * @param event has the code + */ + public onKeyDownCreate(event: KeyboardEvent): void { + if (event.key === 'Enter' && event.shiftKey) { + this.create(); + } + if (event.key === 'Escape') { + this.onCancelCreate(); + } + } + + /** + * Cancels the current form action + */ + public onCancelCreate(): void { + this.statuteParagraphToCreate = null; + } + + /** + * clicking Shift and Enter will save automatically + * clicking Escape will cancel the process + * + * @param event has the code + */ + public onKeyDownUpdate(event: KeyboardEvent): void { + if (event.key === 'Enter' && event.shiftKey) { + const myParagraph = this.statuteParagraphs.find(x => x.id === this.editId); + this.onSaveButton(myParagraph); + } + if (event.key === 'Escape') { + this.onCancelUpdate(); + } + } + + /** + * Cancels the current form action + */ + public onCancelUpdate(): void { + this.editId = null; + } } diff --git a/client/src/app/site/tags/components/tag-list/tag-list.component.ts b/client/src/app/site/tags/components/tag-list/tag-list.component.ts index 4465c7aab..8e4fb91fe 100644 --- a/client/src/app/site/tags/components/tag-list/tag-list.component.ts +++ b/client/src/app/site/tags/components/tag-list/tag-list.component.ts @@ -138,7 +138,10 @@ export class TagListComponent extends ListViewBaseComponent implements * @param event */ public keyDownFunction(event: KeyboardEvent): void { - if (event.key === "Enter") { + if (event.key === 'Enter' && event.shiftKey) { + this.submitNewTag(); + } + if (event.key === "Escape") { this.cancelEditing(); } }
@@ -50,7 +51,7 @@ Save - Cancel + Cancel
@@ -39,7 +40,7 @@ Save - + Cancel @@ -53,7 +54,9 @@ {{ statuteParagraph.title }} - + Edit statute paragraph: @@ -85,7 +88,7 @@ mat-icon-button> edit - close diff --git a/client/src/app/site/motions/components/statute-paragraph-list/statute-paragraph-list.component.ts b/client/src/app/site/motions/components/statute-paragraph-list/statute-paragraph-list.component.ts index 1b63ecc25..04aefada6 100644 --- a/client/src/app/site/motions/components/statute-paragraph-list/statute-paragraph-list.component.ts +++ b/client/src/app/site/motions/components/statute-paragraph-list/statute-paragraph-list.component.ts @@ -155,4 +155,49 @@ export class StatuteParagraphListComponent extends BaseViewComponent implements public sortStatuteParagraphs(): void { console.log('Not yet implemented. Depends on other Features'); } + + /** + * clicking Shift and Enter will save automatically + * clicking Escape will cancel the process + * + * @param event has the code + */ + public onKeyDownCreate(event: KeyboardEvent): void { + if (event.key === 'Enter' && event.shiftKey) { + this.create(); + } + if (event.key === 'Escape') { + this.onCancelCreate(); + } + } + + /** + * Cancels the current form action + */ + public onCancelCreate(): void { + this.statuteParagraphToCreate = null; + } + + /** + * clicking Shift and Enter will save automatically + * clicking Escape will cancel the process + * + * @param event has the code + */ + public onKeyDownUpdate(event: KeyboardEvent): void { + if (event.key === 'Enter' && event.shiftKey) { + const myParagraph = this.statuteParagraphs.find(x => x.id === this.editId); + this.onSaveButton(myParagraph); + } + if (event.key === 'Escape') { + this.onCancelUpdate(); + } + } + + /** + * Cancels the current form action + */ + public onCancelUpdate(): void { + this.editId = null; + } } diff --git a/client/src/app/site/tags/components/tag-list/tag-list.component.ts b/client/src/app/site/tags/components/tag-list/tag-list.component.ts index 4465c7aab..8e4fb91fe 100644 --- a/client/src/app/site/tags/components/tag-list/tag-list.component.ts +++ b/client/src/app/site/tags/components/tag-list/tag-list.component.ts @@ -138,7 +138,10 @@ export class TagListComponent extends ListViewBaseComponent implements * @param event */ public keyDownFunction(event: KeyboardEvent): void { - if (event.key === "Enter") { + if (event.key === 'Enter' && event.shiftKey) { + this.submitNewTag(); + } + if (event.key === "Escape") { this.cancelEditing(); } }
@@ -85,7 +88,7 @@ mat-icon-button> edit