From d310a5200b0e799ea91f745d6e3bba9bebcf91d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E7=AB=8B=E5=B8=AE?= <3294713004@qq.com> Date: Fri, 24 Jan 2025 11:56:24 +0800 Subject: [PATCH] =?UTF-8?q?Fix:=20=E4=BF=AE=E5=A4=8D=E5=9C=A8=E7=BA=BF?= =?UTF-8?q?=E7=89=88=E4=B8=8B=E4=B8=8A=E4=BC=A0=E5=90=8E=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mixly-modules/electron/burn-upload.js | 2 +- .../modules/mixly-modules/web/burn-upload.js | 18 +++++++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/common/modules/mixly-modules/electron/burn-upload.js b/common/modules/mixly-modules/electron/burn-upload.js index 66cbfa3b..c30719be 100644 --- a/common/modules/mixly-modules/electron/burn-upload.js +++ b/common/modules/mixly-modules/electron/burn-upload.js @@ -253,7 +253,7 @@ BU.initWithDropdownBox = function (type, startPath) { }, end: function () { $('#mixly-loader-div').css('display', 'none'); - $("#layui-layer-shade" + layerNum).remove(); + $(`#layui-layer-shade${layerNum}`).remove(); } }); } diff --git a/common/modules/mixly-modules/web/burn-upload.js b/common/modules/mixly-modules/web/burn-upload.js index 14e027ef..fba7f4ac 100644 --- a/common/modules/mixly-modules/web/burn-upload.js +++ b/common/modules/mixly-modules/web/burn-upload.js @@ -423,7 +423,7 @@ BU.burnWithAdafruitEsptool = async (binFile, erase) => { statusBarTerminal.addValue("Done!\n"); BU.burning = true; BU.uploading = false; - layer.open({ + const layerNum = layer.open({ type: 1, title: Msg.Lang['shell.burning'] + '...', content: $('#mixly-loader-div'), @@ -462,6 +462,9 @@ BU.burnWithAdafruitEsptool = async (binFile, erase) => { await espStub.port.close(); } } + }, + end: function () { + $(`#layui-layer-shade${layerNum}`).remove(); } }); } @@ -595,7 +598,7 @@ BU.uploadByUSB = async (portName) => { const data = goog.get(importsMap[key]['__path__']); FSWrapper.writeFile(filename, data); } - layer.open({ + const layerNum = layer.open({ type: 1, title: Msg.Lang['shell.uploading'] + '...', content: $('#mixly-loader-div'), @@ -641,6 +644,7 @@ BU.uploadByUSB = async (portName) => { end: function () { $('#mixly-loader-btn').css('display', 'inline-block'); $('#mixly-loader-div').css('display', 'none'); + $(`#layui-layer-shade${layerNum}`).remove(); } }); } @@ -662,7 +666,7 @@ BU.uploadWithAmpy = (portName) => { } else if (Serial.type === 'hid') { dataLength = 31; } - layer.open({ + const layerNum = layer.open({ type: 1, title: Msg.Lang['shell.uploading'] + '...', content: $('#mixly-loader-div'), @@ -735,6 +739,7 @@ BU.uploadWithAmpy = (portName) => { end: function () { $('#mixly-loader-btn').css('display', 'inline-block'); $('#mixly-loader-div').css('display', 'none'); + $(`#layui-layer-shade${layerNum}`).remove(); } }); } @@ -861,13 +866,13 @@ BU.burnWithSpecialBin = () => { }); firmwareMap[firmware.name] = firmware.binFile; } - LayerExt.open({ + const layerNum = LayerExt.open({ title: [Msg.Lang['nav.btn.burn'], '36px'], area: ['400px', '160px'], max: false, min: false, content: BU.FILMWARE_LAYER, - shade: Mixly.LayerExt.SHADE_ALL, + shade: LayerExt.SHADE_ALL, resize: false, success: function (layero, index) { const $select = layero.find('select'); @@ -898,6 +903,9 @@ BU.burnWithSpecialBin = () => { beforeEnd: function (layero) { layero.find('select').select2('destroy'); layero.find('button').off(); + }, + end: function () { + $(`#layui-layer-shade${layerNum}`).remove(); } }); }