Skip to content

Commit

Permalink
fix(#175): Toggling of subscription button in js
Browse files Browse the repository at this point in the history
- toggling only takes place when the button is present
  • Loading branch information
abhiabhi94 committed Mar 26, 2021
1 parent 1b5a043 commit 58bfb87
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions comment/static/js/comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,10 @@ document.addEventListener('DOMContentLoaded', () => {
commentCount(1);
// update followBtn
let followButton = form.parentElement.previousElementSibling.querySelector(".js-comment-follow");
followButton.querySelector('.comment-follow-icon').classList.add('user-has-followed');
followButton.querySelector('span').setAttribute('title', 'Unfollow this thread');
if (followButton){
followButton.querySelector('.comment-follow-icon').classList.add('user-has-followed');
followButton.querySelector('span').setAttribute('title', 'Unfollow this thread');
}
}
formButton.setAttribute('disabled', 'disabled');
let elements = document.getElementsByClassName("js-comment-input");
Expand Down

0 comments on commit 58bfb87

Please sign in to comment.