From 37a1d9a8be2675d5d6d0cad21a1cb34b37b77f40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A5=87=E8=B6=A3=E4=BF=9D=E7=BD=97?= <dreamer_paul@126.com> Date: Thu, 6 May 2021 23:12:48 +0800 Subject: [PATCH] Fix #21 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复关闭看板娘后位置偏移,交互元素依然显示的问题 --- static/pio.css | 6 ++++-- static/pio.js | 13 ++++++++++--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/static/pio.css b/static/pio.css index 1d3a1ec..1f8278b 100644 --- a/static/pio.css +++ b/static/pio.css @@ -2,7 +2,7 @@ # Pio Plugin # By: Dreamer-Paul -# Last Update: 2021.3.3 +# Last Update: 2021.5.6 一个支持更换 Live2D 模型的 Typecho 插件。 @@ -39,7 +39,9 @@ transform: translateX(.5em); } -.pio-container.hidden #pio{ +.pio-container.hidden #pio, +.pio-container.hidden .pio-action, +.pio-container.hidden .pio-dialog{ display: none; } diff --git a/static/pio.js b/static/pio.js index d357942..72389d2 100644 --- a/static/pio.js +++ b/static/pio.js @@ -2,9 +2,9 @@ # Pio Plugin # By: Dreamer-Paul -# Last Update: 2021.3.3 +# Last Update: 2021.5.6 -一个支持更换 Live2D 模型的 Typecho 插件。 +一个支持更换 Live2D 模型的 JS 插件 本代码为奇趣保罗原创,并遵守 GPL 2.0 开源协议。欢迎访问我的博客:https://paugram.com @@ -171,7 +171,7 @@ var Paul_Pio = function (prop) { // 夜间模式 if(prop.night){ elements.night.onclick = function () { - eval(prop.night); + typeof prop.night === "function" ? prop.night() : eval(prop.night); }; elements.night.onmouseover = function () { modules.render("夜间点击这里可以保护眼睛呢"); @@ -271,6 +271,13 @@ var Paul_Pio = function (prop) { // 隐藏状态 this.initHidden = function () { + // ! 清除预设好的间距 + if(prop.mode === "draggable"){ + current.body.style.top = null; + current.body.style.left = null; + current.body.style.bottom = null; + } + current.body.classList.add("hidden"); dialog.classList.remove("active");