Sha256: 99dae120d04c46c2e782de2a0cdd068bd4912502bd3ca34afb96ccff0346ecf0
Contents?: true
Size: 1.3 KB
Versions: 117
Compression:
Stored size: 1.3 KB
Contents
<%= pb_rails("button", props: { count: 153, highlight: false, icon: "🎉", classname: "count", id: "reaction-button-highlight", variant: "reaction" }) %> <%= pb_rails("button", props: { count: 5, icon: "😍", variant: "reaction", margin_left: "lg" }) %> <%= pb_rails("button", props: { variant: "reaction", margin_left: "lg" }) %> <%= pb_rails("button", props: { icon: "user", variant: "reaction", margin_left: "lg" }) %> <script> function renderButtonReaction() { let highlightActive = false; function toggleHighlight() { let reactionCount = 153; console.log("toggleHighlight", highlightActive) highlightActive = !highlightActive; const innerCountElement = document.querySelector(".count .pb_caption_kit_xs.pl_xxs") const firstButton = document.getElementById("reaction-button-highlight") firstButton.classList.add(highlightActive && "active") firstButton.classList.remove(!highlightActive && "active") innerCountElement.innerHTML = highlightActive ? reactionCount + 1 : reactionCount; console.log("element", innerCountElement) } const button1 = document.getElementById("reaction-button-highlight") button1.addEventListener("click", toggleHighlight); } renderButtonReaction(); </script>
Version data entries
117 entries across 117 versions & 2 rubygems