From 68d113201c69fa54cdab1f5ddf80ac1f7938cccd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E7=8C=AB=E5=AD=90neko?= <815743831@qq.com> Date: Wed, 10 Nov 2021 17:26:18 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=87=8D=E5=91=BD?= =?UTF-8?q?=E5=90=8Dsheet=E4=B8=BA=E7=A9=BA=E6=97=B6=E7=9A=84tooltip?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E6=97=A0=E6=B3=95=E8=BF=9B=E8=A1=8C=E4=B8=8B?= =?UTF-8?q?=E4=B8=80=E6=AD=A5=E4=BB=BB=E4=BD=95=E6=93=8D=E4=BD=9C=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/sheetBar.js | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/controllers/sheetBar.js b/src/controllers/sheetBar.js index 6f76ea5..8a821cd 100644 --- a/src/controllers/sheetBar.js +++ b/src/controllers/sheetBar.js @@ -271,20 +271,15 @@ export function initialSheetBar(){ return; } - if(0 === $(this).text().length){ + let $t = $(this); + let txt = $t.text(), oldtxt = $t.data("oldtxt"); + if(0 === $(this).text().length){ tooltip.info("", locale_sheetconfig.sheetNamecannotIsEmptyError); - - setTimeout(()=>{ - $(this).text(oldSheetFileName); - luckysheetsheetnameeditor($(this)); - $(this).focus(); - }, 1); + $t.text(oldtxt).attr("contenteditable", "false"); return; } - let $t = $(this); - let txt = $t.text(), oldtxt = $t.data("oldtxt"); if(txt.length>31 || txt.charAt(0)=="'" || txt.charAt(txt.length-1)=="'" || /[:\:\\\/?\?\*\[\]]+/.test(txt)){ alert(locale_sheetconfig.sheetNameSpecCharError); setTimeout(()=>{