From: Guy Pyrzak Date: Sat, 18 Sep 2010 23:22:46 +0000 (+0200) Subject: Bug 574338: When comment box is positioned at [top|bottom], include "Add Comment... X-Git-Tag: bugzilla-4.0rc1~69 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=20042bdad32b87550e61faa4f4c353a9d13ccd2e;p=thirdparty%2Fbugzilla.git Bug 574338: When comment box is positioned at [top|bottom], include "Add Comment" link at [bottom|top] r/a=mkanat --- diff --git a/js/comments.js b/js/comments.js index 79bdae855f..697cedd20e 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; +} diff --git a/template/en/default/bug/comments.html.tmpl b/template/en/default/bug/comments.html.tmpl index e44e4e7b95..9a7a050afe 100644 --- a/template/en/default/bug/comments.html.tmpl +++ b/template/en/default/bug/comments.html.tmpl @@ -65,6 +65,14 @@ [% count = count + increment %] [% END %] +[% IF user.settings.comment_box_position.value == "before_comments" && user.id %] +
+ + Add Comment +
+[% END %] + [%# Note: this template is used in multiple places; if you use this hook, # make sure you are aware of this fact. #%] @@ -78,6 +86,11 @@ return false;">Collapse All Comments
  • Expand All Comments
  • + [% IF user.settings.comment_box_position.value == "after_comments" && user.id %] +
  • + Add Comment
  • + [% END %] [% END %]