mirror of
https://github.com/cotes2020/jekyll-theme-chirpy.git
synced 2026-03-22 02:48:15 +00:00
chore: update ESLint dependencies and improve js style
This commit is contained in:
@@ -8,7 +8,7 @@ const lightImages = '.popup:not(.dark)';
|
||||
const darkImages = '.popup:not(.light)';
|
||||
let selector = lightImages;
|
||||
|
||||
function updateImages(current, reverse) {
|
||||
function swapImages(current, reverse) {
|
||||
if (selector === lightImages) {
|
||||
selector = darkImages;
|
||||
} else {
|
||||
@@ -19,7 +19,7 @@ function updateImages(current, reverse) {
|
||||
reverse = GLightbox({ selector: `${selector}` });
|
||||
}
|
||||
|
||||
[current, reverse] = [reverse, current];
|
||||
return [reverse, current];
|
||||
}
|
||||
|
||||
export function imgPopup() {
|
||||
@@ -43,7 +43,7 @@ export function imgPopup() {
|
||||
|
||||
window.addEventListener('message', (event) => {
|
||||
if (event.source === window && event.data && event.data.id === Theme.ID) {
|
||||
updateImages(current, reverse);
|
||||
[current, reverse] = swapImages(current, reverse);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
"@babel/preset-env": "^7.29.0",
|
||||
"@commitlint/cli": "^20.4.4",
|
||||
"@commitlint/config-conventional": "^20.4.4",
|
||||
"@eslint/js": "^10.0.0",
|
||||
"@rollup/plugin-babel": "^7.0.0",
|
||||
"@rollup/plugin-node-resolve": "^16.0.3",
|
||||
"@rollup/plugin-terser": "^1.0.0",
|
||||
|
||||
Reference in New Issue
Block a user