summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorczaks <marcin@6irc.net>2013-08-04 06:08:10 -0400
committerczaks <marcin@6irc.net>2013-08-04 06:08:10 -0400
commit71db41720629a25110f69097bf149f96c71c29ef (patch)
treea658b432d6799ed3fb6acd289a9c70a6e57dbdca
parent3e4545d1b8218db2814e42c04e0208ee8752eddc (diff)
post-hover.js: ukko fix
-rw-r--r--js/post-hover.js20
1 files changed, 14 insertions, 6 deletions
diff --git a/js/post-hover.js b/js/post-hover.js
index 48f0ed96..1d0c2902 100644
--- a/js/post-hover.js
+++ b/js/post-hover.js
@@ -23,7 +23,14 @@ onready(function(){
} else {
return;
}
-
+
+ var board = $(this);
+ while (board.data('board') === undefined) {
+ board = board.parent();
+ }
+ var threadid = board.attr('id');
+ board = board.data('board');
+
var $post = false;
var hovering = false;
var hovered_at;
@@ -43,6 +50,7 @@ onready(function(){
$newPost.find('span.mentioned').remove();
$newPost
.attr('id', 'post-hover-' + id)
+ .attr('data-board', board)
.addClass('post-hover')
.css('position', 'absolute')
.css('border-style', 'solid')
@@ -53,7 +61,7 @@ onready(function(){
}
};
- $post = $('div.post#reply_' + id);
+ $post = $('[data-board="' + board + '"] div.post#reply_' + id);
if($post.length > 0) {
start_hover($(this));
} else {
@@ -69,12 +77,12 @@ onready(function(){
context: document.body,
success: function(data) {
$(data).find('div.post.reply').each(function() {
- if($('#' + $(this).attr('id')).length == 0)
- $('div.post:first').prepend($(this).css('display', 'none').addClass('hidden'));
+ if($('[data-board="' + board + '"] #' + $(this).attr('id')).length == 0)
+ $('[data-board="' + board + '"]#' + threadid + " .post.reply:first").before($(this).css('display', 'none').addClass('hidden'));
});
- $post = $('div.post#reply_' + id);
+ $post = $('[data-board="' + board + '"] div.post#reply_' + id);
if(hovering && $post.length > 0) {
start_hover($link);
}
@@ -94,7 +102,7 @@ onready(function(){
if(!$post)
return;
- var $hover = $('#post-hover-' + id);
+ var $hover = $('#post-hover-' + id + '[data-board="' + board + '"]');
if($hover.length == 0)
return;