mirror of
https://github.com/Eggbertx/gochan.git
synced 2025-08-03 19:56:22 -07:00
Don't care about the current page as long as ref'd post is on it
This commit is contained in:
parent
5bfbeabf13
commit
4e4974b832
3 changed files with 12 additions and 16 deletions
|
@ -100,26 +100,22 @@ function expandPost(e) {
|
|||
$next.remove();
|
||||
return;
|
||||
}
|
||||
let url = e.target.href
|
||||
let urlArr = postrefRE.exec(url);
|
||||
if(urlArr == null) return; // not actually a link to a post, abort
|
||||
let postBoard = urlArr[1];
|
||||
let postOP = urlArr[2];
|
||||
let postID = urlArr[4]?urlArr[4]:urlArr[2];
|
||||
let href = e.target.href
|
||||
let hrefArr = postrefRE.exec(href);
|
||||
if(hrefArr == null) return; // not actually a link to a post, abort
|
||||
let postID = hrefArr[4]?hrefArr[4]:hrefArr[2];
|
||||
|
||||
let pageThread = getPageThread();
|
||||
let $post = null;
|
||||
|
||||
if(pageThread.board == postBoard && pageThread.op == postOP) {
|
||||
$post = $(`div#op${postID}, div#reply${postID}`).first();
|
||||
if($post.length < 1) return; // post not on this page.
|
||||
let $post = $(`div#op${postID}, div#reply${postID}`).first();
|
||||
if($post.length > 0) {
|
||||
$preview = createPostPreview(e, $post, e.type == "click");
|
||||
if(e.type == "mouseenter") {
|
||||
$hoverPreview = $preview.insertAfter(e.target);
|
||||
$(document.body).on("mousemove", previewMoveHandler);
|
||||
}
|
||||
} else if(e.type == "click") {
|
||||
$.get(e.target.href, data => {
|
||||
return
|
||||
}
|
||||
if(e.type == "click") {
|
||||
$.get(href, data => {
|
||||
$post = $(data).find(`div#op${postID}, div#reply${postID}`).first();
|
||||
if($post.length < 1) return; // post not on this page.
|
||||
createPostPreview(e, $post, true);
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue