(cm, e)
| 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 |
no test coverage detected