MCPcopy Create free account
hub / github.com/feiyu563/PrometheusAlert / onFocus

Function onFocus

static/plugins/codemirror/codemirror.js:3327–3345  ·  view source on GitHub ↗
(cm, e)

Source from the content-addressed store, hash-verified

3325 }
3326
3327 function onFocus(cm, e) {
3328 if (cm.state.delayingBlurEvent && !cm.state.draggingText) { cm.state.delayingBlurEvent = false; }
3329
3330 if (cm.options.readOnly == "nocursor") { return }
3331 if (!cm.state.focused) {
3332 signal(cm, "focus", cm, e);
3333 cm.state.focused = true;
3334 addClass(cm.display.wrapper, "CodeMirror-focused");
3335 // This test prevents this from firing when a context
3336 // menu is closed (since the input reset would kill the
3337 // select-all detection hack)
3338 if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) {
3339 cm.display.input.reset();
3340 if (webkit) { setTimeout(function () { return cm.display.input.reset(true); }, 20); } // Issue #1730
3341 }
3342 cm.display.input.receivedFocus();
3343 }
3344 restartBlink(cm);
3345 }
3346 function onBlur(cm, e) {
3347 if (cm.state.delayingBlurEvent) { return }
3348

Callers 3

ensureFocusFunction · 0.70
CodeMirrorFunction · 0.70
registerEventHandlersFunction · 0.70

Calls 3

signalFunction · 0.85
restartBlinkFunction · 0.85
addClassFunction · 0.70

Tested by

no test coverage detected