MCPcopy Create free account
hub / github.com/breck7/scroll / onFocus

Function onFocus

external/.scrollLibs.js:4645–4671  ·  view source on GitHub ↗
(cm, e)

Source from the content-addressed store, hash-verified

4643 }
4644
4645 function onFocus(cm, e) {
4646 if (cm.state.delayingBlurEvent) {
4647 cm.state.delayingBlurEvent = false
4648 }
4649
4650 if (cm.options.readOnly == "nocursor") {
4651 return
4652 }
4653 if (!cm.state.focused) {
4654 signal(cm, "focus", cm, e)
4655 cm.state.focused = true
4656 addClass(cm.display.wrapper, "CodeMirror-focused")
4657 // This test prevents this from firing when a context
4658 // menu is closed (since the input reset would kill the
4659 // select-all detection hack)
4660 if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) {
4661 cm.display.input.reset()
4662 if (webkit) {
4663 setTimeout(function () {
4664 return cm.display.input.reset(true)
4665 }, 20)
4666 } // Issue #1730
4667 }
4668 cm.display.input.receivedFocus()
4669 }
4670 restartBlink(cm)
4671 }
4672 function onBlur(cm, e) {
4673 if (cm.state.delayingBlurEvent) {
4674 return

Callers 2

ensureFocusFunction · 0.85
registerEventHandlersFunction · 0.85

Calls 3

signalFunction · 0.85
addClassFunction · 0.85
restartBlinkFunction · 0.85

Tested by

no test coverage detected