From e59a2cc1ee976c75cbcb6fedc5258b2d5ac0c1da Mon Sep 17 00:00:00 2001 From: fofolee Date: Tue, 14 May 2019 02:17:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=80=80=E5=87=BA=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/index.js | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/assets/index.js b/assets/index.js index 7ad7e8e0..4548b3e5 100644 --- a/assets/index.js +++ b/assets/index.js @@ -96,11 +96,7 @@ highlightManual = (selector, text) => { } // 初始化 -init = () => { - $("#mainlist").fadeOut(); - $("#options").fadeOut(); - $("#manual").fadeOut(); - $('link[name="manual"]').remove(); +scrollInit = () => { $("html").niceScroll(); $("#manual").niceScroll(); } @@ -139,7 +135,7 @@ loadList = addnum => { // 进入插件 utools.onPluginEnter( async ({ code, type, payload }) => { - init(); + scrollInit(); checkUpdate(); if (code == 'options') { window.defaultPage = 0; @@ -224,6 +220,13 @@ utools.onPluginEnter( async ({ code, type, payload }) => { } }); +utools.onPluginOut(() => { + $("#mainlist").html(''); + $("#options").html(''); + $("#manual").html(''); + $('link[name="manual"]').remove(); +}) + // 单击列表,显示手册; 中键发送文本 $("#mainlist").on('mousedown', '.info', function (e) { if (1 == e.which) { @@ -264,11 +267,6 @@ $("#manual").on('mousedown', 'a', function (e) { } }); -$(document).on('error', 'img', function () { - console.log(1); - $(this).remove(); - }); - // 滚动到边界加载列表 $(document).scroll(() => { loadList(500);