right sidebar: Ensure .user-with-count gets added to correct li element.

The count_span element is parented by a .selectable_sidebar_block element
which is parented by the li element that the class is supposed to be added
to. Thus, use the parents() jQuery method for locating the li parent so
that the class gets added to the correct element.
This commit is contained in:
Cynthia Lin 2019-05-22 10:26:02 +00:00 committed by Tim Abbott
parent 5ca2e43e44
commit a65007dde4
2 changed files with 2 additions and 2 deletions

View File

@ -383,7 +383,7 @@ run_test('PM_update_dom_counts', () => {
buddy_list_add(pm_key, li);
count.set_find_results('.value', value);
li.set_find_results('.count', count);
count.set_parent(li);
count.set_parents_result('li', li);
const counts = new Dict();
counts.set(pm_key, 5);

View File

@ -33,7 +33,7 @@ exports.new_user_input = true;
var huddle_timestamps = new Dict();
function update_pm_count_in_dom(count_span, value_span, count) {
var li = count_span.parent();
var li = count_span.parents('li');
if (count === 0) {
count_span.hide();