Refactor editor write handler to a seperate method

This commit is contained in:
Kristóf Tóth 2018-06-12 19:15:15 +02:00
parent 0fc90126a7
commit 8f19bf3661
2 changed files with 7 additions and 3 deletions

View File

@ -39,8 +39,6 @@
<ngx-monaco-editor [(ngModel)]="code"
class="tfw-ide-editor"
(keyup)="setCodeState(CodeState.DIRTY);
setDeployButtonState(DeployButtonState.TODEPLOY);
resetAutoSaveCountdown()"
(keyup)="editorWriteHanlder()"
[options]="editorOptions"
></ngx-monaco-editor>

View File

@ -151,6 +151,12 @@ export class IdeComponent implements OnInit {
this.requestCode();
}
editorWriteHanlder() {
this.setCodeState(CodeState.DIRTY);
this.setDeployButtonState(DeployButtonState.TODEPLOY);
this.resetAutoSaveCountdown();
}
setCodeState(state: CodeState) {
this.codeState = state;
}