META-INF.resources.butterfaces-dist-js.butterfaces-checkbox.js Maven / Gradle / Ivy
var ButterFaces;
(function (ButterFaces) {
var Checkbox = /** @class */ (function () {
function Checkbox() {
}
Checkbox.addSwitchClickEvent = function (checkboxId) {
var checkbox = document.getElementById(checkboxId);
checkbox.querySelector(".slider").addEventListener("click", function (event) {
console.log("Checkbox switch clicked to " + event.target);
checkbox.querySelector("label").click();
});
};
return Checkbox;
}());
ButterFaces.Checkbox = Checkbox;
})(ButterFaces || (ButterFaces = {}));
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJ1dHRlcmZhY2VzLWNoZWNrYm94LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLElBQVUsV0FBVyxDQWFwQjtBQWJELFdBQVUsV0FBVztJQUNqQjtRQUFBO1FBV0EsQ0FBQztRQVRpQiw0QkFBbUIsR0FBakMsVUFBa0MsVUFBa0I7WUFDaEQsSUFBSSxRQUFRLEdBQWdCLFFBQVEsQ0FBQyxjQUFjLENBQUMsVUFBVSxDQUFDLENBQUM7WUFFaEUsUUFBUSxDQUFDLGFBQWEsQ0FBQyxTQUFTLENBQUMsQ0FBQyxnQkFBZ0IsQ0FBQyxPQUFPLEVBQUUsVUFBVSxLQUFVO2dCQUM1RSxPQUFPLENBQUMsR0FBRyxDQUFDLDZCQUE2QixHQUFHLEtBQUssQ0FBQyxNQUFNLENBQUMsQ0FBQztnQkFDMUQsUUFBUSxDQUFDLGFBQWEsQ0FBQyxPQUFPLENBQUMsQ0FBQyxLQUFLLEVBQUUsQ0FBQztZQUM1QyxDQUFDLENBQUMsQ0FBQztRQUNQLENBQUM7UUFFTCxlQUFDO0lBQUQsQ0FYQSxBQVdDLElBQUE7SUFYWSxvQkFBUSxXQVdwQixDQUFBO0FBQ0wsQ0FBQyxFQWJTLFdBQVcsS0FBWCxXQUFXLFFBYXBCIiwiZmlsZSI6ImJ1dHRlcmZhY2VzLWN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