From 7ec82f878e379df85e7581266d319a82efdaf367 Mon Sep 17 00:00:00 2001 From: czaks Date: Sun, 29 Dec 2013 18:32:58 +0100 Subject: [PATCH] post-hover.js: fix long loop Conflicts: js/post-hover.js --- js/post-hover.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/js/post-hover.js b/js/post-hover.js index db434dfa..d96a55fc 100644 --- a/js/post-hover.js +++ b/js/post-hover.js @@ -24,6 +24,24 @@ onready(function(){ return; } + var board = $(this); + var i = 0; + while (board.data('board') === undefined) { + board = board.parent(); + i++; + if (i >= 10) return; + } + var threadid; + if ($link.is('[data-thread]')) threadid = 0; + else threadid = board.attr('id').replace("thread_", ""); + + board = board.data('board'); + + var parentboard = board; + + if ($link.is('[data-thread]')) parentboard = $('form[name="post"] input[name="board"]').val(); + else if (matches[1] !== undefined) board = matches[1]; + var $post = false; var hovering = false; var hovered_at;