Sha256: 2b0fd4fbcc0209763ece04271f8306df18a784e4e9354c1763d99181c3b829c9
Contents?: true
Size: 1.31 KB
Versions: 1395
Compression:
Stored size: 1.31 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: "1️⃣", 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
1,395 entries across 1,395 versions & 2 rubygems