Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var closeOpenedCommentIfNotOnSelectedElements = function(e) {
// Don't do anything if clicked on the following elements:
if (shouldNotCloseComment(e) // any of the comment icons
|| commentBoxes.shouldNotCloseComment(e)) { // a comment box or the comment modal
return;
}
// All clear, can close the comment
var openedComment = findOpenedComment();
if (openedComment) {
toggleActiveCommentIcon($(openedComment));
var commentId = openedComment.getAttribute("data-commentid");
commentBoxes.hideComment(commentId, true);
}
}