All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.resources.butterfaces-ts.butterfaces-radiobox.ts Maven / Gradle / Ivy

The newest version!
namespace ButterFaces {
    export class RadioBox {

        public static addStyleClassClickEvent(radioBoxId: string) {
            let radioBox: any = document.getElementById(radioBoxId);

            radioBox.addEventListener("change", function (event:any) {
                console.log("Remove radio selection classes");
                [].forEach.call(
                    document.querySelectorAll(".radio"),
                    function (el: any) {
                        console.log(el);
                        el.classList.remove("butter-radio-item-selected");
                    }
                );

                console.log("Add radio selection class to " + event.target);
                event.target.parentNode.classList.add("butter-radio-item-selected");
            });
        }

    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy