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: "&#127881;", 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

Version Path
playbook_ui_docs-13.9.0.pre.alpha.play845allkitsbytypes1266 app/pb_kits/playbook/pb_button/docs/_button_reaction.html.erb
playbook_ui-13.9.0.pre.alpha.play845allkitsbytypes1266 app/pb_kits/playbook/pb_button/docs/_button_reaction.html.erb
playbook_ui_docs-13.9.0.pre.alpha.play845allkitsbytypes1264 app/pb_kits/playbook/pb_button/docs/_button_reaction.html.erb
playbook_ui-13.9.0.pre.alpha.play845allkitsbytypes1264 app/pb_kits/playbook/pb_button/docs/_button_reaction.html.erb
playbook_ui_docs-13.9.0.pre.alpha.play845allkitsbytypes1263 app/pb_kits/playbook/pb_button/docs/_button_reaction.html.erb
playbook_ui-13.9.0.pre.alpha.play845allkitsbytypes1263 app/pb_kits/playbook/pb_button/docs/_button_reaction.html.erb
playbook_ui_docs-13.9.0.pre.alpha.play845allkitsbytypes1262 app/pb_kits/playbook/pb_button/docs/_button_reaction.html.erb
playbook_ui-13.9.0.pre.alpha.play845allkitsbytypes1262 app/pb_kits/playbook/pb_button/docs/_button_reaction.html.erb
playbook_ui_docs-13.9.0.pre.alpha.PLAY962SingleSelect1261 app/pb_kits/playbook/pb_button/docs/_button_reaction.html.erb
playbook_ui-13.9.0.pre.alpha.PLAY962SingleSelect1261 app/pb_kits/playbook/pb_button/docs/_button_reaction.html.erb
playbook_ui_docs-13.9.0.pre.alpha.play845allkitsbytypes1260 app/pb_kits/playbook/pb_button/docs/_button_reaction.html.erb
playbook_ui-13.9.0.pre.alpha.play845allkitsbytypes1260 app/pb_kits/playbook/pb_button/docs/_button_reaction.html.erb
playbook_ui-13.9.0 app/pb_kits/playbook/pb_button/docs/_button_reaction.html.erb
playbook_ui_docs-13.8.0.pre.alpha.PLAY1016reactionbuttonemojibug1245 app/pb_kits/playbook/pb_button/docs/_button_reaction.html.erb
playbook_ui-13.8.0.pre.alpha.PLAY1016reactionbuttonemojibug1245 app/pb_kits/playbook/pb_button/docs/_button_reaction.html.erb