Skip to content

Commit

Permalink
feat: 优化点击图片外关闭
Browse files Browse the repository at this point in the history
  • Loading branch information
Night-stars-1 committed Aug 23, 2024
1 parent 402ee0c commit 4fe80af
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/renderer.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* @Date: 2024-01-09 00:35:45
* LastEditors: Night-stars-1 [email protected]
* LastEditTime: 2024-02-17 18:08:08
*LastEditors: Night-stars-1 [email protected]
*LastEditTime: 2024-08-23 20:02:52
*/
import { domUpMessages } from "./renderer/domUpMessages.js"
import { changeHref, domUpNavItem } from "./renderer/changeHref.js"
Expand Down Expand Up @@ -36,7 +36,7 @@ async function onLoad() {
const GlobalCSS_file_path = `local:///${plugin_path}/src/config/global.css`;
const GlobalCSS_element = document.createElement("link");
GlobalCSS_element.rel = "stylesheet";
GlobalCSS_element.href = css_file_path;
GlobalCSS_element.href = GlobalCSS_file_path;
document.head.appendChild(GlobalCSS_element);
updateStyle(() => {
link_element.href = `${css_file_path}?r=${new Date().getTime()}`;
Expand Down
5 changes: 4 additions & 1 deletion src/renderer/changeHref.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* @Date: 2024-01-19 16:44:32
*LastEditors: Night-stars-1 [email protected]
*LastEditTime: 2024-08-23 19:46:21
*LastEditTime: 2024-08-23 20:03:47
*/
import { output } from "./utils.js"
import { config, setSettings } from "./config.js"
Expand Down Expand Up @@ -51,6 +51,9 @@ function changeHref(location) {
clearInterval(interval);
const closeElement = document.createElement("div")
closeElement.classList.add("close-image")
closeElement.addEventListener('click', (event) => {
document.querySelector(".close").click()
});
mainAreaRotateElement.appendChild(closeElement)
// const mainAreaElement = mainAreaRotateElement.querySelector(".main-area__image-wrap")
// // 监听图片的点击事件
Expand Down

0 comments on commit 4fe80af

Please sign in to comment.