MCPcopy Create free account
hub / github.com/candybox2/candybox2.github.io / run

Method run

code/main/RenderLinkInput.ts:17–39  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

15
16 // Public methods
17 public run(): void{
18 // We copy the render link so we can use it in the functions below
19 var renderLink: RenderLinkInput = this;
20
21 // We set the change event
22 $(this.element).change(function(event){
23 // We check if the new value correspond to the answer (if it does we fire the callbacks)
24 if(renderLink.enigmaAnswer.isRight($(this).val()))
25 renderLink.callbackCollection.fire();
26 // Here it means that the new value doesn't correspond to the answers
27 else if(renderLink.callbackCollectionWrong != null){
28 renderLink.callbackCollectionWrong.fire();
29 }
30
31 // We empty the input area
32 $(this).val("");
33
34 return false; // Avoid event bubbling
35 });
36
37 // We set the focus
38 $(this.element).focus();
39 }
40}

Callers

nothing calls this directly

Calls 6

$Function · 0.85
changeMethod · 0.80
valMethod · 0.80
focusMethod · 0.80
fireMethod · 0.65
isRightMethod · 0.45

Tested by

no test coverage detected