From 2d6289609f35560dddadd4e577e756e1d753c519 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20T=C3=B3th?= Date: Wed, 28 Feb 2018 15:38:22 +0100 Subject: [PATCH] Implement tab switching saving files --- src/app/webide/webide.component.html | 2 +- src/app/webide/webide.component.ts | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/app/webide/webide.component.html b/src/app/webide/webide.component.html index 125ff21..5a2a2a6 100644 --- a/src/app/webide/webide.component.html +++ b/src/app/webide/webide.component.html @@ -3,7 +3,7 @@ class="btn btn-secondary" [class.active]="filename === file" [class.disabled]="filename === file" - (click)="selectCode(file); requestCode()" + (click)="sendCodeContents(); selectCode(file); requestCode()" [disabled]="filename === file"> {{file}} diff --git a/src/app/webide/webide.component.ts b/src/app/webide/webide.component.ts index 6fc1ec5..2180d8e 100644 --- a/src/app/webide/webide.component.ts +++ b/src/app/webide/webide.component.ts @@ -85,12 +85,16 @@ export class WebideComponent implements OnInit { } sendCode() { + this.sendCodeContents(); + this.saveButtonState = 'SAVING'; + this.processManagerService.restartProcess('login'); + } + + sendCodeContents() { this.webSocketService.send(this.key_id, { 'command': 'write', 'content': this.code }); - this.saveButtonState = 'SAVING'; - this.processManagerService.restartProcess('login'); } requestCode() {