Refactor setButtonState family of callbacks

This commit is contained in:
Kristóf Tóth 2018-03-02 15:48:45 +01:00
parent 3266854db8
commit 3cfcf8fddc
2 changed files with 6 additions and 10 deletions

View File

@ -9,7 +9,7 @@
</button> </button>
</div> </div>
<div (keypress)="setSaveButtonStateDirty(); setDeployButtonStateTodeploy(); resetAutoSaveCountdown()" <div (keypress)="setSaveButtonState('DIRTY'); setDeployButtonState('TODEPLOY'); resetAutoSaveCountdown()"
ace-editor ace-editor
[(text)]="code" [(text)]="code"
[mode]="language" [mode]="language"

View File

@ -50,7 +50,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) => { this.setDeployButtonStateDeployed(); }); this.processManagerService.subscribeCallback('login', (event) => { this.setDeployButtonState('DEPLOYED'); });
this.resetAutoSaveCountdown(); this.resetAutoSaveCountdown();
} }
@ -100,16 +100,12 @@ export class WebideComponent implements OnInit {
this.requestCode(); this.requestCode();
} }
setSaveButtonStateDirty() { setSaveButtonState(state: string) {
this.saveButtonState = 'DIRTY'; this.saveButtonState = state;
} }
setDeployButtonStateDeployed() { setDeployButtonState(state: string) {
this.deployButtonState = 'DEPLOYED'; this.deployButtonState = state;
}
setDeployButtonStateTodeploy() {
this.deployButtonState = 'TODEPLOY';
} }
deployCode() { deployCode() {