mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 12:49:34 +00:00
fhem_codemirror.js: Fix FireFox 58+ problems with lineNumbers (Forum #87740)
git-svn-id: https://svn.fhem.de/fhem/trunk@16926 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
dd89b3274b
commit
b40f6c321c
@ -162,16 +162,21 @@ function cm_wait(cm_editor, callback, recursions) {
|
||||
return;
|
||||
}
|
||||
|
||||
var cm = CodeMirror.fromTextArea(cm_editor, cm_attr);
|
||||
// setTimeout needed for FireFox 58+, Forum #87740
|
||||
setTimeout(function(){
|
||||
var cm = CodeMirror.fromTextArea(cm_editor, cm_attr);
|
||||
|
||||
if (cm_attr.autocomplete && cm_attr.autocompleteAlways) {
|
||||
cm.on("keyup", function (cm, event) {
|
||||
if ( !cm.state.completionActive && String.fromCharCode(event.keyCode).match(/\w/) ) {
|
||||
CodeMirror.commands.autocomplete(cm, null, {completeSingle: false});
|
||||
}
|
||||
});
|
||||
}
|
||||
if (cm_attr.autocomplete && cm_attr.autocompleteAlways) {
|
||||
cm.on("keyup", function (cm, event) {
|
||||
if ( !cm.state.completionActive &&
|
||||
String.fromCharCode(event.keyCode).match(/\w/) ) {
|
||||
CodeMirror.commands.autocomplete(cm, null,
|
||||
{completeSingle: false});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if(callback)
|
||||
callback(cm);
|
||||
if(callback)
|
||||
callback(cm);
|
||||
}, 10);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user