fail silently when checkbox js util is already setup

This commit is contained in:
Felix Hamann 2019-04-07 22:28:04 +02:00
parent d48b335cb2
commit c6a175ae5a

View File

@ -152,11 +152,13 @@
}
if (element.classList.contains(CHECKBOX_INITIALIZED_CLASS)) {
throw new Error('Checkbox utility already initialized!');
// throw new Error('Checkbox utility already initialized!');
return false;
}
if (element.parentElement.classList.contains(CHECKBOX_CLASS)) {
throw new Error('Checkbox element\'s wrapper already has class "' + CHECKBOX_CLASS + '"!');
// throw new Error('Checkbox element\'s wrapper already has class "' + CHECKBOX_CLASS + '"!');
return false;
}
var siblingEl = element.nextElementSibling;