Update webide frontend to emphasize that a process is being reloaded

This commit is contained in:
Kristóf Tóth 2018-02-28 14:13:01 +01:00
parent 0779ad2ef6
commit 52298cbd8c
2 changed files with 6 additions and 6 deletions

View File

@ -23,8 +23,8 @@
type="submit" type="submit"
class="btn btn-secondary" class="btn btn-secondary"
[class.btn-success]="saveButtonState === 'SAVED'" [class.btn-success]="saveButtonState === 'SAVED'"
[class.btn-warning]="saveButtonState === 'SAVING'" [class.btn-info]="saveButtonState === 'SAVING'"
[class.disabled]="saveButtonState === 'SAVING'" [class.disabled]="saveButtonState === 'SAVING'"
><span *ngIf="saveButtonState === 'DIRTY'">Save!</span> ><span *ngIf="saveButtonState === 'DIRTY'">Save!</span>
<span *ngIf="saveButtonState === 'SAVED'">Saved!</span> <span *ngIf="saveButtonState === 'SAVED'">Done!</span>
<span *ngIf="saveButtonState === 'SAVING'">Saving...</span></button> <span *ngIf="saveButtonState === 'SAVING'">Reloading...</span></button>

View File

@ -36,7 +36,7 @@ export class WebideComponent implements OnInit {
command_handlers = { 'reload': this.reloadHandler.bind(this), command_handlers = { 'reload': this.reloadHandler.bind(this),
'read': this.readHandler.bind(this), 'read': this.readHandler.bind(this),
'select': this.selectHandler.bind(this), 'select': this.selectHandler.bind(this),
'write': this.writeHandler.bind(this)}; 'write': () => {}};
constructor(private webSocketService: WebSocketService, constructor(private webSocketService: WebSocketService,
private changeDetectorRef: ChangeDetectorRef, private changeDetectorRef: ChangeDetectorRef,
@ -47,7 +47,7 @@ export class WebideComponent implements OnInit {
this.subscribeWS(); this.subscribeWS();
this.requestCode(); this.requestCode();
this.processManagerService.init(); this.processManagerService.init();
this.processManagerService.subscribeCallback('login', (event) => { console.log('CICÁK!!'); }); this.processManagerService.subscribeCallback('login', (event) => { this.setButtonStateSaved(); });
} }
subscribeWS() { subscribeWS() {
@ -76,7 +76,7 @@ export class WebideComponent implements OnInit {
this.updateFileData(data); this.updateFileData(data);
} }
writeHandler(data: SourceCode) { setButtonStateSaved() {
this.saveButtonState = 'SAVED'; this.saveButtonState = 'SAVED';
} }