- fix - detail panel not update when switch booru.
This commit is contained in:
defaultkavy 2024-10-18 16:34:12 +08:00
parent 1913e010b6
commit b5bd8aa736
Signed by: defaultkavy
GPG Key ID: DFBB22C4E69D7826
4 changed files with 6 additions and 5 deletions

File diff suppressed because one or more lines are too long

2
dist/index.html vendored
View File

@ -16,7 +16,7 @@
gtag('config', 'G-59HBGP98WR');
</script>
<script type="module" crossorigin src="/assets/index-C_KR8nb7.js"></script>
<script type="module" crossorigin src="/assets/index-BWVK_Osd.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-BgVVzy-z.css">
</head>
<body>

View File

@ -2,7 +2,7 @@
"name": "danbooru-viewer",
"module": "index.ts",
"type": "module",
"version": "0.10.0",
"version": "0.10.1",
"scripts": {
"dev": "bun x vite",
"build": "bun x vite build",

View File

@ -189,10 +189,11 @@ function $postsPageComponents($route: $Route, query: {tags?: string}) {
const $postGrid = new $PostGrid(query);
const $detail = new $DetailPanel({preview: true, tagsType: 'name_only'}).hide(detailPanelEnable$.convert(bool => !bool)).position($route);
detailPanelCheck();
detailPanelEnable$.on('update', detailPanelCheck)
detailPanelEnable$.on('update', detailPanelCheck);
Booru.events.on('set', () => $detail.update(null));
function detailPanelCheck() { detailPanelEnable$.value ? $postGrid.addClass('detail-panel-enabled') : $postGrid.removeClass('detail-panel-enabled') }
$postGrid.$focus
.on('focus', ({$focused: $target}) => {if ($target instanceof $PostTile) $detail.update($target.post) })
.on('focus', ({$focused: $target}) => {if ($target.inDOM() && $target instanceof $PostTile) $detail.update($target.post) })
.on('blur', () => $detail.update(null))
return { $postGrid, $detail };
}