From 33551151cd027d5820a1507628c8fbb1ce2e6f14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=AB=E8=B0=B7=E5=89=91=E4=BB=99?= Date: Thu, 25 Jul 2024 05:23:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E4=BA=AB=E6=90=9C=E7=B4=A2=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=E4=B9=9F=E7=A1=AE=E4=BF=9D=E5=BC=B9=E5=87=BA=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E7=AA=97=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script.js | 28 +++++++++++++++------------- service-worker.js | 2 +- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/script.js b/script.js index bbb27c96..33e363c2 100644 --- a/script.js +++ b/script.js @@ -2211,6 +2211,19 @@ function reloadFormationData(event) { paddbTeamId.value = `https://paddb.net/team/${_id}`; } + //恢复上一次的搜索状态 + const searchOptions = ((str)=>{ + try { + const obj = JSON.parse(str); + return obj.attrs ? obj : null; + } catch (error) { + return null; + } + })(getQueryString('search-options') || sessionStorage.getItem('search-options')); + if (searchOptions) { + editBox?.querySelector(".search-box")?.recoverySearchStatus(searchOptions); + } + //编辑模式直接打开编辑框 let editingTarget = ((str)=>{ try { @@ -2220,7 +2233,8 @@ function reloadFormationData(event) { return null; } })(sessionStorage.getItem('editing')); - if (!editingTarget && isGuideMod) editingTarget = [0,0,0]; + + if (!editingTarget && (isGuideMod || searchOptions)) editingTarget = [0,0,0]; if (editingTarget) { const mid = event?.state?.mid ?? parseInt(getQueryString("id"), 10); @@ -2246,18 +2260,6 @@ function reloadFormationData(event) { editBox.hide(); } - //恢复上一次的搜索状态 - const searchOptions = ((str)=>{ - try { - const obj = JSON.parse(str); - return obj.attrs ? obj : null; - } catch (error) { - return null; - } - })(getQueryString('search-options') || sessionStorage.getItem('search-options')); - if (searchOptions) { - editBox?.querySelector(".search-box")?.recoverySearchStatus(searchOptions); - } refreshAll(formation); } diff --git a/service-worker.js b/service-worker.js index 5edeb774..4e9f129c 100644 --- a/service-worker.js +++ b/service-worker.js @@ -30243,7 +30243,7 @@ const cachesMap = new Map([ ], [ "script.js", - "9ec1b0af5a159d8455fb60a9aea0fd31" + "dc322be758e879d0c5ad90c5a891687c" ], [ "solo.html",