MCPcopy Index your code
hub / github.com/DHTMLX/gantt / onFocus

Function onFocus

samples/common/codehighlight/codemirror.js:3303–3321  ·  view source on GitHub ↗
(cm, e)

Source from the content-addressed store, hash-verified

3301 }
3302
3303 function onFocus(cm, e) {
3304 if (cm.state.delayingBlurEvent && !cm.state.draggingText) { cm.state.delayingBlurEvent = false; }
3305
3306 if (cm.options.readOnly == "nocursor") { return }
3307 if (!cm.state.focused) {
3308 signal(cm, "focus", cm, e);
3309 cm.state.focused = true;
3310 addClass(cm.display.wrapper, "CodeMirror-focused");
3311 // This test prevents this from firing when a context
3312 // menu is closed (since the input reset would kill the
3313 // select-all detection hack)
3314 if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) {
3315 cm.display.input.reset();
3316 if (webkit) { setTimeout(function () { return cm.display.input.reset(true); }, 20); } // Issue #1730
3317 }
3318 cm.display.input.receivedFocus();
3319 }
3320 restartBlink(cm);
3321 }
3322 function onBlur(cm, e) {
3323 if (cm.state.delayingBlurEvent) { return }
3324

Callers 3

ensureFocusFunction · 0.85
CodeMirrorFunction · 0.85
registerEventHandlersFunction · 0.85

Calls 3

signalFunction · 0.85
addClassFunction · 0.85
restartBlinkFunction · 0.85

Tested by

no test coverage detected