mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-06-08 06:55:36 +08:00
增加退出插件事件
This commit is contained in:
parent
717f674017
commit
e59a2cc1ee
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user