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

Version Path
playbook_ui_docs-13.8.0.pre.alpha.play845allkitsbytypes1258 app/pb_kits/playbook/pb_button/docs/_button_reaction.html.erb
playbook_ui-13.8.0.pre.alpha.play845allkitsbytypes1258 app/pb_kits/playbook/pb_button/docs/_button_reaction.html.erb
playbook_ui_docs-13.8.0.pre.alpha.play845allkitsbytypes1257 app/pb_kits/playbook/pb_button/docs/_button_reaction.html.erb
playbook_ui-13.8.0.pre.alpha.play845allkitsbytypes1257 app/pb_kits/playbook/pb_button/docs/_button_reaction.html.erb
playbook_ui_docs-13.8.0.pre.alpha.PLAY962SingleSelect1256 app/pb_kits/playbook/pb_button/docs/_button_reaction.html.erb
playbook_ui-13.8.0.pre.alpha.PLAY962SingleSelect1256 app/pb_kits/playbook/pb_button/docs/_button_reaction.html.erb
playbook_ui_docs-13.8.0.pre.alpha.play845allkitsbytypes1255 app/pb_kits/playbook/pb_button/docs/_button_reaction.html.erb
playbook_ui-13.8.0.pre.alpha.play845allkitsbytypes1255 app/pb_kits/playbook/pb_button/docs/_button_reaction.html.erb
playbook_ui_docs-13.8.0.pre.alpha.play845allkitsbytypes1254 app/pb_kits/playbook/pb_button/docs/_button_reaction.html.erb
playbook_ui-13.8.0.pre.alpha.play845allkitsbytypes1254 app/pb_kits/playbook/pb_button/docs/_button_reaction.html.erb
playbook_ui_docs-13.8.0.pre.alpha.PLAY962SingleSelect1246 app/pb_kits/playbook/pb_button/docs/_button_reaction.html.erb
playbook_ui-13.8.0.pre.alpha.PLAY962SingleSelect1246 app/pb_kits/playbook/pb_button/docs/_button_reaction.html.erb
playbook_ui-13.8.0 app/pb_kits/playbook/pb_button/docs/_button_reaction.html.erb
playbook_ui_docs-13.7.0.pre.alpha.play845allkitsbytypes1234 app/pb_kits/playbook/pb_button/docs/_button_reaction.html.erb
playbook_ui-13.7.0.pre.alpha.play845allkitsbytypes1234 app/pb_kits/playbook/pb_button/docs/_button_reaction.html.erb
playbook_ui_docs-13.7.0.pre.alpha.play845allkitsbytypes1232 app/pb_kits/playbook/pb_button/docs/_button_reaction.html.erb
playbook_ui-13.7.0.pre.alpha.play845allkitsbytypes1232 app/pb_kits/playbook/pb_button/docs/_button_reaction.html.erb
playbook_ui_docs-13.7.0.pre.alpha.play845allkitsbytypes1231 app/pb_kits/playbook/pb_button/docs/_button_reaction.html.erb
playbook_ui-13.7.0.pre.alpha.play845allkitsbytypes1231 app/pb_kits/playbook/pb_button/docs/_button_reaction.html.erb
playbook_ui_docs-13.7.0.pre.alpha.play978makehighchartsadevdependencypoc1223 app/pb_kits/playbook/pb_button/docs/_button_reaction.html.erb