From 93c02a23b2121c6722ce4e40d5b63106700ed148 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E7=AB=8B=E5=B8=AE?= <3294713004@qq.com> Date: Tue, 11 Mar 2025 01:59:47 +0800 Subject: [PATCH] =?UTF-8?q?Update:=20=E4=BC=98=E5=8C=96=E5=9B=BE=E5=BD=A2?= =?UTF-8?q?=E5=9D=97=E5=8F=98=E5=8A=A8=E8=A7=A6=E5=8F=91=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=9B=B4=E6=94=B9=E6=97=B6=E7=9A=84=E7=9B=91=E5=90=AC=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mixly-modules/common/editor-mix.js | 23 ++++--------------- 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/common/modules/mixly-modules/common/editor-mix.js b/common/modules/mixly-modules/common/editor-mix.js index 53c7d348..0c21d2bb 100644 --- a/common/modules/mixly-modules/common/editor-mix.js +++ b/common/modules/mixly-modules/common/editor-mix.js @@ -56,23 +56,6 @@ class EditorMix extends EditorBase { 'html/editor/editor-mix-btns.html', new HTMLTemplate(goog.get(path.join(Env.templatePath, 'html/editor/editor-mix-btns.html'))) ); - - this.BLOCKLY_IGNORE_EVENTS = [ - Blockly.Events.UI, - Blockly.Events.VIEWPORT_CHANGE, - Blockly.Events.COMMENT_CHANGE, - Blockly.Events.COMMENT_CREATE, - Blockly.Events.COMMENT_DELETE, - Blockly.Events.COMMENT_MOVE, - Blockly.Events.TRASHCAN_OPEN, - Blockly.Events.CLICK, - Blockly.Events.SELECTED, - Blockly.Events.THEME_CHANGE, - Blockly.Events.BUBBLE_OPEN, - Blockly.Events.THEME_CHANGE, - Blockly.Events.TOOLBOX_ITEM_SELECT, - Blockly.Events.BLOCK_DRAG - ]; } #language_ = null; @@ -365,7 +348,11 @@ class EditorMix extends EditorBase { this.codeChangeListener = blocklyWorkspace.addChangeListener((event) => { const blockPage = this.getPage('block'); const codePage = this.getPage('code'); - if (EditorMix.BLOCKLY_IGNORE_EVENTS.includes(event.type)) { + if ( + event.isUiEvent || + event.type == Blockly.Events.FINISHED_LOADING || + blocklyWorkspace.isDragging() + ) { return; } this.addDirty();