From aaec472f73bebf16685cb64649453dd1e8603997 Mon Sep 17 00:00:00 2001 From: ebolam Date: Sat, 15 Jul 2023 15:20:18 -0400 Subject: [PATCH] Fix for toggles not showing up right in model backend settings --- static/application.js | 4 ++++ static/koboldai.js | 3 +++ 2 files changed, 7 insertions(+) diff --git a/static/application.js b/static/application.js index f8905a45..053d7d53 100644 --- a/static/application.js +++ b/static/application.js @@ -4188,6 +4188,10 @@ function selected_model_info(sent_data) { toggle.checked = item['default']; toggle.onclick = onchange_event; toggle.setAttribute("data_type", item['unit']); + toggle.classList.add("bootstrap_toggle"); + $('.bootstrap_toggle').bootstrapToggle('state', item['default']); + toggle.classList.remove("bootstrap_toggle"); + toggle.setAttribute("refresh_model_inputs", item['refresh_model_inputs']); if ('check' in item) { toggle.check_data = item['check']; diff --git a/static/koboldai.js b/static/koboldai.js index c9d66cb6..57c91be4 100644 --- a/static/koboldai.js +++ b/static/koboldai.js @@ -1863,6 +1863,9 @@ function selected_model_info(sent_data) { toggle.onclick = onchange_event; toggle.setAttribute("data_type", item['unit']); toggle.setAttribute("refresh_model_inputs", item['refresh_model_inputs']); + toggle.classList.add("bootstrap_toggle"); + $('.bootstrap_toggle').bootstrapToggle('state', item['default']); + toggle.classList.remove("bootstrap_toggle"); if ('check' in item) { toggle.check_data = item['check']; } else {