Sha256: 2b0fd4fbcc0209763ece04271f8306df18a784e4e9354c1763d99181c3b829c9

Contents?: true

Size: 1.31 KB

Versions: 1454

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,454 entries across 1,454 versions & 2 rubygems

Version Path
playbook_ui-14.11.1.pre.alpha.play1724darkmodeauditmap5437 app/pb_kits/playbook/pb_button/docs/_button_reaction.html.erb
playbook_ui_docs-14.11.1.pre.alpha.PBNTR719listdraggablesimple5432 app/pb_kits/playbook/pb_button/docs/_button_reaction.html.erb
playbook_ui-14.11.1.pre.alpha.PBNTR719listdraggablesimple5432 app/pb_kits/playbook/pb_button/docs/_button_reaction.html.erb
playbook_ui_docs-14.11.1.pre.alpha.PBNTR768stickyrightcolumn5431 app/pb_kits/playbook/pb_button/docs/_button_reaction.html.erb
playbook_ui-14.11.1.pre.alpha.PBNTR768stickyrightcolumn5431 app/pb_kits/playbook/pb_button/docs/_button_reaction.html.erb
playbook_ui_docs-14.12.0.pre.rc.6 app/pb_kits/playbook/pb_button/docs/_button_reaction.html.erb
playbook_ui-14.12.0.pre.rc.6 app/pb_kits/playbook/pb_button/docs/_button_reaction.html.erb
playbook_ui_docs-14.11.1.pre.alpha.PBNTR718simiplifieddraggablereact5415 app/pb_kits/playbook/pb_button/docs/_button_reaction.html.erb
playbook_ui-14.11.1.pre.alpha.PBNTR718simiplifieddraggablereact5415 app/pb_kits/playbook/pb_button/docs/_button_reaction.html.erb
playbook_ui_docs-14.11.1.pre.alpha.play1724darkmodeauditmap5413 app/pb_kits/playbook/pb_button/docs/_button_reaction.html.erb
playbook_ui-14.11.1.pre.alpha.play1724darkmodeauditmap5413 app/pb_kits/playbook/pb_button/docs/_button_reaction.html.erb
playbook_ui_docs-14.12.0.pre.rc.5 app/pb_kits/playbook/pb_button/docs/_button_reaction.html.erb
playbook_ui-14.12.0.pre.rc.5 app/pb_kits/playbook/pb_button/docs/_button_reaction.html.erb
playbook_ui_docs-14.11.1.pre.alpha.play1724darkmodeauditmap5409 app/pb_kits/playbook/pb_button/docs/_button_reaction.html.erb
playbook_ui-14.11.1.pre.alpha.play1724darkmodeauditmap5409 app/pb_kits/playbook/pb_button/docs/_button_reaction.html.erb
playbook_ui_docs-14.11.1.pre.alpha.PBNTR718simiplifieddraggablereact5400 app/pb_kits/playbook/pb_button/docs/_button_reaction.html.erb
playbook_ui-14.11.1.pre.alpha.PBNTR718simiplifieddraggablereact5400 app/pb_kits/playbook/pb_button/docs/_button_reaction.html.erb
playbook_ui_docs-14.11.1.pre.alpha.PBNTR718simiplifieddraggablereact5392 app/pb_kits/playbook/pb_button/docs/_button_reaction.html.erb
playbook_ui-14.11.1.pre.alpha.PBNTR718simiplifieddraggablereact5392 app/pb_kits/playbook/pb_button/docs/_button_reaction.html.erb
playbook_ui_docs-14.11.1.pre.alpha.PLAY1720phonenumberinputformatAsYouType5377 app/pb_kits/playbook/pb_button/docs/_button_reaction.html.erb