diff --git a/templates/repo_view_file.html b/templates/repo_view_file.html
index 617f166355..f5fd5b41d8 100644
--- a/templates/repo_view_file.html
+++ b/templates/repo_view_file.html
@@ -377,11 +377,13 @@ $('#shared-link').click(function() {
{% if request.user.is_authenticated %}
$('#bottom-bar').append('');
$('#file-comment').css({'max-height':$(window).height() - parseInt($('#file-comment').css('bottom'))});
+{% if groups %}
var gids = '';
{% for g in groups %}
gids += '{{ g.id }}_';
{% endfor %}
addAtAutocomplete('#comment-input', '#comment-container', gids, "{% url 'group_attention' %}", {'width':'315px','padding-left':'1px','height':'36px','margin':'0','font-size':'13px', 'font-family':'Arial, Helvetica, sans-serif', 'line-height': '1.5em', 'border':'1px solid #ddd'});
+{% endif %}
$('#comment-input').bind('autocompleteopen', function(e, ui) {
var menu = $(this).autocomplete('widget');
if (parseInt(menu.css('top')) > 0) {
diff --git a/templates/snippets/bottom_bar.html b/templates/snippets/bottom_bar.html
index 8adf517883..86f0dd32be 100644
--- a/templates/snippets/bottom_bar.html
+++ b/templates/snippets/bottom_bar.html
@@ -59,10 +59,10 @@ $(document).click(function(e) {
$('#to-group, #to-group-caret').addClass('hide');
}
});
+{% endif %}
$(function() {
var btn_height = $('#bottom-bar button').outerHeight();
$('#recommend-to-group-caret, #to-group-caret, #comment-caret').css({'bottom': btn_height + 1});
$('#file-comment, #to-group, #recommend-to-group-form').css({'bottom': btn_height + 1 + $('.outer-caret').outerHeight()});
});
-{% endif %}