From 7e1a42dc52939cbb114603da39eb649ba1ffe2a5 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 26 Jul 2019 18:10:16 +0800 Subject: [PATCH] ctr s --- .../page/component/monaco/TPIMonaco.js | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) 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)