mirror of
				https://github.com/avatao-content/frontend-tutorial-framework
				synced 2025-11-04 14:12:55 +00:00 
			
		
		
		
	Refactor editor write handler to a seperate method
This commit is contained in:
		@@ -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>
 | 
			
		||||
 
 | 
			
		||||
@@ -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;
 | 
			
		||||
  }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user