From f1d9113d83214ba08069f695ba176dec90a0d770 Mon Sep 17 00:00:00 2001 From: Guy Pyrzak Date: Sun, 19 Sep 2010 01:20:02 +0200 Subject: Bug 574338: When comment box is positioned at [top|bottom], include "Add Comment" link at [bottom|top] r/a=mkanat --- js/comments.js | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'js') diff --git a/js/comments.js b/js/comments.js index 79bdae855..697cedd20 100644 --- a/js/comments.js +++ b/js/comments.js @@ -86,3 +86,14 @@ function addCollapseLink(count) { '); return false;" title="Collapse the comment.">[-]<\/a> '); } +function goto_add_comments( anchor ){ + anchor = (anchor || "add_comment"); + // we need this line to expand the comment box + document.getElementById('comment').focus(); + setTimeout(function(){ + document.location.hash = anchor; + // firefox doesn't seem to keep focus through the anchor change + document.getElementById('comment').focus(); + },10); + return false; +} -- cgit v1.2.3-24-g4f1b