From ab6ee862f4292aa6bdeb17f8d299cf6d17d05266 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 21 Oct 2019 18:23:10 +0800 Subject: [PATCH] blur --- public/react/src/modules/page/VNCContainer.js | 5 +++++ public/react/src/modules/page/component/monaco/TPIMonaco.js | 3 +++ 2 files changed, 8 insertions(+) diff --git a/public/react/src/modules/page/VNCContainer.js b/public/react/src/modules/page/VNCContainer.js index 36943f73b..4a591f4ac 100644 --- a/public/react/src/modules/page/VNCContainer.js +++ b/public/react/src/modules/page/VNCContainer.js @@ -40,6 +40,10 @@ class VNCContainer extends Component { getSecondDrawerWidth = () => { return $('#game_right_contents').width() - firstDrawerWidth } + onEditBlur = () => { + console.log('blurblur') + this.doFileUpdateRequestOnCodeMirrorBlur() + } doFileUpdateRequestOnCodeMirrorBlur = () => { if (!this.currentPath) { console.error('未找到文件path') @@ -83,6 +87,7 @@ class VNCContainer extends Component { isEditablePath={shixun.code_edit_permission} shixun={this.props.shixun} doFileUpdateRequestOnCodeMirrorBlur={this.doFileUpdateRequestOnCodeMirrorBlur} + onEditBlur={this.onEditBlur} > diff --git a/public/react/src/modules/page/component/monaco/TPIMonaco.js b/public/react/src/modules/page/component/monaco/TPIMonaco.js index 0d5eb2d34..b814ecb44 100644 --- a/public/react/src/modules/page/component/monaco/TPIMonaco.js +++ b/public/react/src/modules/page/component/monaco/TPIMonaco.js @@ -347,6 +347,9 @@ class TPIMonaco extends Component { this.props.doFileUpdateRequestOnCodeMirrorBlur(); return false; }); + window.editor_monaco.onDidBlurEditorWidget(() => { + this.props.onEditBlur && this.props.onEditBlur(); + }) }) // window.document.onkeydown = (e) => {