From 9b354e9bd1e6d0d346b30230387b4a8cb54623bd Mon Sep 17 00:00:00 2001 From: Naman Agrawal Date: Wed, 19 Jun 2024 13:13:43 -0500 Subject: [PATCH] feat: add option to hide comment disclaimer --- feedback-widget.js | 33 ++++++++++++++++++++++++--------- feedback-widget.min.js | 18 +++++++++--------- 2 files changed, 33 insertions(+), 18 deletions(-) diff --git a/feedback-widget.js b/feedback-widget.js index 28f35cf..db371cd 100644 --- a/feedback-widget.js +++ b/feedback-widget.js @@ -244,6 +244,15 @@ class NJFeedbackWidget extends window.HTMLElement { const contactLink = this.hasAttribute("contact-link") ? this.getAttribute("contact-link") : "https://www.nj.gov/nj/feedback.html"; + + let showCommentDisclaimer = true; + if ( + this.hasAttribute("show-comment-disclaimer") && + this.getAttribute("show-comment-disclaimer") === "false" + ) { + showCommentDisclaimer = false; + } + const html = /*html*/ `
@@ -264,14 +273,18 @@ class NJFeedbackWidget extends window.HTMLElement { -

- ${content.commentPromptDisclaimer}${content.commentPromptDisclaimerLink}. -

+ ${ + showCommentDisclaimer + ? `

+ ${content.commentPromptDisclaimer}${content.commentPromptDisclaimerLink}. +

` + : "" + }