diff --git a/src/frontend/app/notes/note-editor.component.html b/src/frontend/app/notes/note-editor.component.html index b78538f781214511802f46392fadb9faa563743c..25f12504e87823db6add1dd7c6c4052df3c996d2 100644 --- a/src/frontend/app/notes/note-editor.component.html +++ b/src/frontend/app/notes/note-editor.component.html @@ -1,7 +1,7 @@ <mat-form-field appearance="outline" class="noteEditorContent"> <textarea matInput placeholder="{{lang.addNote}}" [(ngModel)]="content"></textarea> <button *ngIf="addMode" matSuffix mat-icon-button title="{{lang.send}}" (click)="addNote()" - [disabled]="content.trim() == ''"> + [disabled]="content.trim() == '' || loading"> <mat-icon fontSet="far" fontIcon="fa-paper-plane fa-2x" style="color: #666;"></mat-icon> </button> <button matSuffix color="primary" mat-icon-button title="{{lang.noteTemplates}}" [matMenuTriggerFor]="menu" diff --git a/src/frontend/app/notes/note-editor.component.ts b/src/frontend/app/notes/note-editor.component.ts index f8bb25d127fbd91185774a017904485323300f9c..cece0bea2574486b6c53fce63b05f2bc17f55bfc 100644 --- a/src/frontend/app/notes/note-editor.component.ts +++ b/src/frontend/app/notes/note-editor.component.ts @@ -13,7 +13,7 @@ export class NoteEditorComponent implements AfterViewInit { lang: any = LANG; notes: any; - loading: boolean = true; + loading: boolean = false; templatesNote: any = []; content: string = ''; @@ -29,9 +29,11 @@ export class NoteEditorComponent implements AfterViewInit { } addNote() { + this.loading = true this.http.post("../../rest/res/" + this.resIds[0] + "/notes", { note_text: this.content }) .subscribe((data: any) => { this.refreshNotes.emit(this.resIds[0]); + this.loading = false; }); }