From 0efc8904ba4dee3f22723eae2a37c4185457bdaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A5=87=E8=B6=A3=E4=BF=9D=E7=BD=97?= Date: Fri, 12 Aug 2022 01:17:37 +0800 Subject: [PATCH] Fix: Custom Content MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 再次修复变量异常(this 要换成 currentTarget 啦) --- static/pio.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/static/pio.js b/static/pio.js index 2ef6bc0..42c7775 100644 --- a/static/pio.js +++ b/static/pio.js @@ -217,14 +217,14 @@ var Paul_Pio = function (prop) { for (let i = 0; i < el.length; i++) { if (item.type === "read") { - el[i].onmouseover = () => { - const text = this.getAttribute("title") || this.innerText; + el[i].onmouseover = (ev) => { + const text = ev.currentTarget.title || ev.currentTarget.innerText; modules.message("想阅读 %t 吗?".replace(/%t/, "“" + text + "”")); } } else if (item.type === "link") { - el[i].onmouseover = () => { - const text = this.getAttribute("title") || this.innerText; + el[i].onmouseover = (ev) => { + const text = ev.currentTarget.title || ev.currentTarget.innerText; modules.message("想了解一下 %t 吗?".replace(/%t/, "“" + text + "”")); } }