v0.10.5 - fix focus and blur triggered same time
This commit is contained in:
parent
5eb5ef289d
commit
eb2cbf688a
1
dist/assets/index-C9jgFl23.js
vendored
1
dist/assets/index-C9jgFl23.js
vendored
File diff suppressed because one or more lines are too long
1
dist/assets/index-D9u7pURH.js
vendored
Normal file
1
dist/assets/index-D9u7pURH.js
vendored
Normal file
File diff suppressed because one or more lines are too long
2
dist/index.html
vendored
2
dist/index.html
vendored
@ -16,7 +16,7 @@
|
||||
|
||||
gtag('config', 'G-59HBGP98WR');
|
||||
</script>
|
||||
<script type="module" crossorigin src="/assets/index-C9jgFl23.js"></script>
|
||||
<script type="module" crossorigin src="/assets/index-D9u7pURH.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-BgVVzy-z.css">
|
||||
</head>
|
||||
<body>
|
||||
|
@ -2,7 +2,7 @@
|
||||
"name": "danbooru-viewer",
|
||||
"module": "index.ts",
|
||||
"type": "module",
|
||||
"version": "0.10.4",
|
||||
"version": "0.10.5",
|
||||
"scripts": {
|
||||
"dev": "bun x vite",
|
||||
"build": "bun x vite build",
|
||||
|
@ -87,12 +87,14 @@ export class $PostGrid extends $Layout<$PostGridEventMap> {
|
||||
for (const post of posts) {
|
||||
if (!post.file_url) continue;
|
||||
if (this.posts.has(post)) continue;
|
||||
const $post = new $PostTile(post);
|
||||
const $post = new $PostTile(post).on('$focus', (e, $post) => this.$focus.layer(100).focus($post));
|
||||
this.$posts.set(post, $post);
|
||||
this.posts.add(post);
|
||||
}
|
||||
this.$focus.layer(100).elementSet.clear();
|
||||
const $posts = [...this.orderMap.values()].map(post => this.$posts.get(post)?.self(this.$focus.layer(100).add));
|
||||
const $posts = [...this.orderMap.values()].map(post => {
|
||||
return this.$posts.get(post)?.self(this.$focus.layer(100).add)
|
||||
});
|
||||
this.content($posts).render();
|
||||
return this;
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ export class $PostTile extends $Container {
|
||||
if (!detailPanelEnable$.value) return;
|
||||
if (innerWidth <= 800) return $.open(this.post.pathname);
|
||||
if ($(document.activeElement) === this) $.open(this.post.pathname);
|
||||
else this.focus();
|
||||
else this.trigger('$focus');
|
||||
})
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user