META-INF.resources.butterfaces-dist-js.butterfaces-radiobox.js Maven / Gradle / Ivy
var ButterFaces;
(function (ButterFaces) {
var RadioBox = /** @class */ (function () {
function RadioBox() {
}
RadioBox.addStyleClassClickEvent = function (radioBoxId) {
var radioBox = document.getElementById(radioBoxId);
radioBox.addEventListener("change", function (event) {
console.log("Remove radio selection classes");
[].forEach.call(document.querySelectorAll(".radio"), function (el) {
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");
});
};
return RadioBox;
}());
ButterFaces.RadioBox = RadioBox;
})(ButterFaces || (ButterFaces = {}));
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJ1dHRlcmZhY2VzLXJhZGlvYm94LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLElBQVUsV0FBVyxDQXNCcEI7QUF0QkQsV0FBVSxXQUFXO0lBQ2pCO1FBQUE7UUFvQkEsQ0FBQztRQWxCaUIsZ0NBQXVCLEdBQXJDLFVBQXNDLFVBQWtCO1lBQ3BELElBQUksUUFBUSxHQUFRLFFBQVEsQ0FBQyxjQUFjLENBQUMsVUFBVSxDQUFDLENBQUM7WUFFeEQsUUFBUSxDQUFDLGdCQUFnQixDQUFDLFFBQVEsRUFBRSxVQUFVLEtBQVU7Z0JBQ3BELE9BQU8sQ0FBQyxHQUFHLENBQUMsZ0NBQWdDLENBQUMsQ0FBQztnQkFDOUMsRUFBRSxDQUFDLE9BQU8sQ0FBQyxJQUFJLENBQ1gsUUFBUSxDQUFDLGdCQUFnQixDQUFDLFFBQVEsQ0FBQyxFQUNuQyxVQUFVLEVBQU87b0JBQ2IsT0FBTyxDQUFDLEdBQUcsQ0FBQyxFQUFFLENBQUMsQ0FBQztvQkFDaEIsRUFBRSxDQUFDLFNBQVMsQ0FBQyxNQUFNLENBQUMsNEJBQTRCLENBQUMsQ0FBQztnQk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AgICAgICAgICAgICAgY29uc29sZS5sb2coZWwpO1xuICAgICAgICAgICAgICAgICAgICAgICAgZWwuY2xhc3NMaXN0LnJlbW92ZShcImJ1dHRlci1yYWRpby1pdGVtLXNlbGVjdGVkXCIpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgKTtcblxuICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKFwiQWRkIHJhZGlvIHNlbGVjdGlvbiBjbGFzcyB0byBcIiArIGV2ZW50LnRhcmdldCk7XG4gICAgICAgICAgICAgICAgZXZlbnQudGFyZ2V0LnBhcmVudE5vZGUuY2xhc3NMaXN0LmFkZChcImJ1dHRlci1yYWRpby1pdGVtLXNlbGVjdGVkXCIpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cblxuICAgIH1cbn0iXX0=