diff --git a/InvenTree/static/script/inventree/modals.js b/InvenTree/static/script/inventree/modals.js index 7d55d02865..31c2233f8d 100644 --- a/InvenTree/static/script/inventree/modals.js +++ b/InvenTree/static/script/inventree/modals.js @@ -43,6 +43,22 @@ function partialMatcher(params, data) { } +function attachToggle(modal) { + /* Attach 'bootstrap-toggle' functionality to any checkbox in the modal. + * This is simple for visual improvement, + * and also larger toggle style buttons are easier to press! + */ + + $(modal).find("input[type='checkbox']").each(function(x) { + $(this).bootstrapToggle({ + size: 'small', + onstyle: 'success', + offstyle: 'warning', + }); + }); +} + + function attachSelect(modal) { /* Attach 'select2' functionality to any drop-down list in the modal. * Provides search filtering for dropdown items @@ -351,6 +367,7 @@ function injectModalForm(modal, form_html) { */ $(modal).find('.modal-form-content').html(form_html); attachSelect(modal); + attachToggle(modal); } diff --git a/InvenTree/templates/slide.html b/InvenTree/templates/slide.html index d929f1491c..14afc4aa04 100644 --- a/InvenTree/templates/slide.html +++ b/InvenTree/templates/slide.html @@ -1,3 +1,3 @@