Skip to content
Snippets Groups Projects
Verified Commit da122992 authored by Alex ORLUC's avatar Alex ORLUC
Browse files

add disable add note when note adding

parent 2d040900
No related branches found
No related tags found
No related merge requests found
<mat-form-field appearance="outline" class="noteEditorContent"> <mat-form-field appearance="outline" class="noteEditorContent">
<textarea matInput placeholder="{{lang.addNote}}" [(ngModel)]="content"></textarea> <textarea matInput placeholder="{{lang.addNote}}" [(ngModel)]="content"></textarea>
<button *ngIf="addMode" matSuffix mat-icon-button title="{{lang.send}}" (click)="addNote()" <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> <mat-icon fontSet="far" fontIcon="fa-paper-plane fa-2x" style="color: #666;"></mat-icon>
</button> </button>
<button matSuffix color="primary" mat-icon-button title="{{lang.noteTemplates}}" [matMenuTriggerFor]="menu" <button matSuffix color="primary" mat-icon-button title="{{lang.noteTemplates}}" [matMenuTriggerFor]="menu"
......
...@@ -13,7 +13,7 @@ export class NoteEditorComponent implements AfterViewInit { ...@@ -13,7 +13,7 @@ export class NoteEditorComponent implements AfterViewInit {
lang: any = LANG; lang: any = LANG;
notes: any; notes: any;
loading: boolean = true; loading: boolean = false;
templatesNote: any = []; templatesNote: any = [];
content: string = ''; content: string = '';
...@@ -29,9 +29,11 @@ export class NoteEditorComponent implements AfterViewInit { ...@@ -29,9 +29,11 @@ export class NoteEditorComponent implements AfterViewInit {
} }
addNote() { addNote() {
this.loading = true
this.http.post("../../rest/res/" + this.resIds[0] + "/notes", { note_text: this.content }) this.http.post("../../rest/res/" + this.resIds[0] + "/notes", { note_text: this.content })
.subscribe((data: any) => { .subscribe((data: any) => {
this.refreshNotes.emit(this.resIds[0]); this.refreshNotes.emit(this.resIds[0]);
this.loading = false;
}); });
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment