Show More
@@ -46,8 +46,9 b' function addRefLinkPreview(node) {' | |||||
46 |
|
46 | |||
47 | function showPostPreview(e) { |
|
47 | function showPostPreview(e) { | |
48 | var doc = document; |
|
48 | var doc = document; | |
49 | //ref id |
|
49 | ||
50 | var pNum = $(this).text().match(/\d+/); |
|
50 | var reflink = $(this); | |
|
51 | var pNum = reflink.text().match(/\d+/); | |||
51 |
|
52 | |||
52 | if (pNum == null || pNum.length == 0) { |
|
53 | if (pNum == null || pNum.length == 0) { | |
53 | return; |
|
54 | return; | |
@@ -57,8 +58,8 b' function showPostPreview(e) {' | |||||
57 | if (post.length > 0 && isElementInViewport(post)) { |
|
58 | if (post.length > 0 && isElementInViewport(post)) { | |
58 | post.addClass('highlight'); |
|
59 | post.addClass('highlight'); | |
59 | } else { |
|
60 | } else { | |
60 | var x = e.clientX + (doc.documentElement.scrollLeft || doc.body.scrollLeft) + 2; |
|
61 | var x = reflink.offset().left; | |
61 | var y = e.clientY + (doc.documentElement.scrollTop || doc.body.scrollTop); |
|
62 | var y = reflink.offset().top; | |
62 |
|
63 | |||
63 | var cln = doc.createElement('div'); |
|
64 | var cln = doc.createElement('div'); | |
64 | cln.id = 'pstprev_' + pNum; |
|
65 | cln.id = 'pstprev_' + pNum; |
General Comments 0
You need to be logged in to leave comments.
Login now