unregister listeners on closing showCodeMirrorPopup
This commit is contained in:
parent
baab837be4
commit
8679e55206
|
@ -583,10 +583,14 @@ function showCodeMirrorPopup(title, html, options) {
|
|||
keyMap: prefs.get('editor.keyMap')
|
||||
}, options));
|
||||
cm.focus();
|
||||
cm.on('focus', () => cm.rerouteHotkeys(false));
|
||||
cm.on('blur', () => cm.rerouteHotkeys(true));
|
||||
const rerouteOn = () => cm.rerouteHotkeys(false);
|
||||
const rerouteOff = () => cm.rerouteHotkeys(true);
|
||||
cm.on('focus', rerouteOn);
|
||||
cm.on('blur', rerouteOff);
|
||||
window.addEventListener('closeHelp', function _() {
|
||||
window.removeEventListener('closeHelp', _);
|
||||
cm.off('focus', rerouteOn);
|
||||
cm.off('blur', rerouteOff);
|
||||
cm = popup.codebox = null;
|
||||
});
|
||||
return popup;
|
||||
|
|
Loading…
Reference in New Issue
Block a user