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