From a65007dde47e034f2e32beb8765a049fbe74563e Mon Sep 17 00:00:00 2001 From: Cynthia Lin <15116870+synicalsyntax@users.noreply.github.com> Date: Wed, 22 May 2019 10:26:02 +0000 Subject: [PATCH] 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. --- frontend_tests/node_tests/activity.js | 2 +- static/js/activity.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend_tests/node_tests/activity.js b/frontend_tests/node_tests/activity.js index 04b32cac74..8c79b103b6 100644 --- a/frontend_tests/node_tests/activity.js +++ b/frontend_tests/node_tests/activity.js @@ -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); diff --git a/static/js/activity.js b/static/js/activity.js index d69d79d066..22aa7fc8cf 100644 --- a/static/js/activity.js +++ b/static/js/activity.js @@ -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();