Commit 6073b281 authored by Connor Shea's avatar Connor Shea

Fix a bug and a test.

parent e39b3fe3
...@@ -64,8 +64,9 @@ ...@@ -64,8 +64,9 @@
discussionIdsInScope = discussionIdsForElements($(discussionsSelector)); discussionIdsInScope = discussionIdsForElements($(discussionsSelector));
let unresolvedDiscussionCount = 0; let unresolvedDiscussionCount = 0;
for (const discussionId of discussionIdsInScope) {
const discussion = discussions[discussionId]; for (let i = 0; i < discussionIdsInScope.length; i++) {
const discussionId = discussionIdsInScope[i];
if (discussion && !discussion.isResolved()) { if (discussion && !discussion.isResolved()) {
unresolvedDiscussionCount++; unresolvedDiscussionCount++;
} }
...@@ -104,7 +105,8 @@ ...@@ -104,7 +105,8 @@
} }
let currentDiscussionFound = false; let currentDiscussionFound = false;
for (const discussionId of discussionIdsInScope) { for (let i = 0; i < discussionIdsInScope.length; i++) {
const discussionId = discussionIdsInScope[i];
const discussion = discussions[discussionId]; const discussion = discussions[discussionId];
if (!discussion) { if (!discussion) {
...@@ -177,7 +179,7 @@ ...@@ -177,7 +179,7 @@
// If the next discussion is closed, toggle it open. // If the next discussion is closed, toggle it open.
if ($target.find(".js-toggle-content").attr('style') == "display: none;") { if ($target.find(".js-toggle-content").attr('style') == "display: none;") {
$target.find('i').toggleClass('fa fa-chevron-down').toggleClass('fa fa-chevron-up'); $target.find('.js-toggle-button i').toggleClass('fa fa-chevron-down').toggleClass('fa fa-chevron-up');
$target.find(".js-toggle-content").toggle(); $target.find(".js-toggle-content").toggle();
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment