Compare commits

..

No commits in common. "4e9acb65021d4b7982411a3fcb1a4981c24fa60c" and "6c11c67eb43d5532a3ba3425a7d1bf55d7b24232" have entirely different histories.

3 changed files with 7 additions and 19 deletions

View file

@ -32,15 +32,9 @@
let mouse_pos = { top: 0, left: 0 };
function gotoPost(event) {
function gotoPost() {
if (focused) return;
if (event) {
if (event.type == "mouseup" && (
event.button !== 0 ||
event.shiftKey ||
event.ctrlKey)) return;
if (event.key && event.key !== "Enter") return;
}
if (event && event.key && event.key !== "Enter") return;
goto(`/post/${post.id}`);
}
@ -68,7 +62,7 @@
aria-label={aria_label}
bind:this={el}
on:mousedown={e => {mouse_pos.left = e.pageX; mouse_pos.top = e.pageY}}
on:mouseup={e => {if (e.pageX == mouse_pos.left && e.pageY == mouse_pos.top) gotoPost(e)}}
on:mouseup={e => {if (e.pageX == mouse_pos.left && e.pageY == mouse_pos.top) gotoPost()}}
on:keydown={gotoPost}>
<PostHeader post={post} />
<Body post={post} />

View file

@ -16,15 +16,8 @@
let mouse_pos = { top: 0, left: 0 };
function gotoPost(event) {
if (event) {
if (event.type == "mouseup" && (
event.button !== 0 ||
event.shiftKey ||
event.ctrlKey)) return;
if (event.key && event.key !== "Enter") return;
}
function gotoPost() {
if (event && event.key && event.key !== "Enter") return;
goto(`/post/${post.id}`);
}
</script>
@ -39,7 +32,7 @@
class="post-reply"
aria-label={aria_label}
on:mousedown={e => {mouse_pos.left = e.pageX; mouse_pos.top = e.pageY}}
on:mouseup={e => {if (e.pageX == mouse_pos.left && e.pageY == mouse_pos.top) gotoPost(e)}}
on:mouseup={e => {if (e.pageX == mouse_pos.left && e.pageY == mouse_pos.top) gotoPost()}}
on:keydown={gotoPost}>
<div class="line"></div>

View file

@ -42,6 +42,7 @@
);
}
console.log(post);
return post;
})();
</script>