MCPcopy
hub / github.com/csev/py4e / onFocus

Function onFocus

tools/pythonauto/static/codemirrorepl/codemirror.js:3073–3086  ·  view source on GitHub ↗
(cm)

Source from the content-addressed store, hash-verified

3071 // FOCUS/BLUR EVENTS
3072
3073 function onFocus(cm) {
3074 if (cm.options.readOnly == "nocursor") return;
3075 if (!cm.state.focused) {
3076 signal(cm, "focus", cm);
3077 cm.state.focused = true;
3078 addClass(cm.display.wrapper, "CodeMirror-focused");
3079 if (!cm.curOp) {
3080 resetInput(cm);
3081 if (webkit) setTimeout(bind(resetInput, cm, true), 0); // Issue #1730
3082 }
3083 }
3084 slowPoll(cm);
3085 restartBlink(cm);
3086 }
3087 function onBlur(cm) {
3088 if (cm.state.focused) {
3089 signal(cm, "blur", cm);

Callers 1

ensureFocusFunction · 0.70

Calls 6

signalFunction · 0.85
addClassFunction · 0.85
resetInputFunction · 0.70
bindFunction · 0.70
slowPollFunction · 0.70
restartBlinkFunction · 0.70

Tested by

no test coverage detected