diff --git a/public/react/src/modules/page/component/monaco/TPIMonaco.js b/public/react/src/modules/page/component/monaco/TPIMonaco.js index 2ebdb5eab..26f020586 100644 --- a/public/react/src/modules/page/component/monaco/TPIMonaco.js +++ b/public/react/src/modules/page/component/monaco/TPIMonaco.js @@ -320,20 +320,23 @@ class TPIMonaco extends Component { editor.focus(); }, 600) - + window.editor_monaco.addCommand(monaco.KeyMod.CtrlCmd | monaco.KeyCode.KEY_S, () => { + this.props.doFileUpdateRequestOnCodeMirrorBlur(); + return false; + }); }) - window.document.onkeydown = (e) => { - e = window.event || e; - if(e.keyCode== 83 && e.ctrlKey){ - /*延迟,兼容FF浏览器 */ - // setTimeout(function(){ - // alert('ctrl+s'); - // },1); - this.props.doFileUpdateRequestOnCodeMirrorBlur(); - return false; - } - }; + // window.document.onkeydown = (e) => { + // e = window.event || e; + // if(e.keyCode== 83 && e.ctrlKey){ + // /*延迟,兼容FF浏览器 */ + // // setTimeout(function(){ + // // alert('ctrl+s'); + // // },1); + // this.props.doFileUpdateRequestOnCodeMirrorBlur(); + // return false; + // } + // }; } onFontSizeChange = (value) => { toStore('cmFontSize', value)