From c6a175ae5a956ce03616aa3d277edcef5efbb76e Mon Sep 17 00:00:00 2001 From: Felix Hamann Date: Sun, 7 Apr 2019 22:28:04 +0200 Subject: [PATCH] fail silently when checkbox js util is already setup --- static/js/utils/inputs.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/static/js/utils/inputs.js b/static/js/utils/inputs.js index 0081b3000..d332daaa1 100644 --- a/static/js/utils/inputs.js +++ b/static/js/utils/inputs.js @@ -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;