fix(M7.9c): 删除 stSaved 元素后清理 Monaco/CM change 事件中的空引用(防每次输入抛 TypeError 中断保存/预览)
这个提交包含在:
+2
-2
@@ -396,7 +396,7 @@ function bootCodeMirror(){
|
||||
value: defaultCode(),
|
||||
extraKeys:{'Cmd-Enter':()=>doAction(), 'Ctrl-Enter':()=>doAction(), 'Shift-Enter':()=>doAction()}
|
||||
});
|
||||
CM.on('change', function(){ document.getElementById('stSaved').textContent='代码自动保留 ✓'; if(!isMdLang()) lspCheck(); saveCodeToLS(); mdLive(); });
|
||||
CM.on('change', function(){ if(!isMdLang()) lspCheck(); saveCodeToLS(); mdLive(); });
|
||||
ED = {
|
||||
setValue:function(v){ CM.setValue(v); },
|
||||
getValue:function(){ return CM.getValue(); },
|
||||
@@ -422,7 +422,7 @@ function bootMonaco(){
|
||||
/* 注意:Monaco 无 KeyMod.CmdCmd(undefined|Enter 会变成裸 Enter 绑定导致回车即提交)——必须用 CtrlCmd */
|
||||
ed.addCommand(MONACO_LIB.KeyMod.CtrlCmd|MONACO_LIB.KeyCode.Enter, function(){ doAction(); });
|
||||
ed.addCommand(MONACO_LIB.KeyMod.Shift|MONACO_LIB.KeyCode.Enter, function(){ doAction(); });
|
||||
ed.onDidChangeModelContent(function(){ document.getElementById('stSaved').textContent='代码自动保留 ✓'; if(!isMdLang()) lspCheck(); saveCodeToLS(); mdLive(); });
|
||||
ed.onDidChangeModelContent(function(){ if(!isMdLang()) lspCheck(); saveCodeToLS(); mdLive(); });
|
||||
window.__FL_ED=ed;
|
||||
ED = {
|
||||
setValue:function(v){ ed.setValue(v); },
|
||||
|
||||
在新工单中引用
屏蔽一个用户