增加退出插件事件

This commit is contained in:
fofolee 2019-05-14 02:17:21 +08:00
parent 717f674017
commit e59a2cc1ee

View File

@ -96,11 +96,7 @@ highlightManual = (selector, text) => {
} }
// 初始化 // 初始化
init = () => { scrollInit = () => {
$("#mainlist").fadeOut();
$("#options").fadeOut();
$("#manual").fadeOut();
$('link[name="manual"]').remove();
$("html").niceScroll(); $("html").niceScroll();
$("#manual").niceScroll(); $("#manual").niceScroll();
} }
@ -139,7 +135,7 @@ loadList = addnum => {
// 进入插件 // 进入插件
utools.onPluginEnter( async ({ code, type, payload }) => { utools.onPluginEnter( async ({ code, type, payload }) => {
init(); scrollInit();
checkUpdate(); checkUpdate();
if (code == 'options') { if (code == 'options') {
window.defaultPage = 0; 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) { $("#mainlist").on('mousedown', '.info', function (e) {
if (1 == e.which) { 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(() => { $(document).scroll(() => {
loadList(500); loadList(500);