Spaces:
Sleeping
Sleeping
Update nutri_call.html
Browse files- nutri_call.html +1 -12
nutri_call.html
CHANGED
@@ -1192,7 +1192,6 @@ function calculateCationsAndAnions() {
|
|
1192 |
|
1193 |
// 1. Получаем текущие значения из формы
|
1194 |
const getValue = (id) => parseFloat(document.getElementById(id).value) || 0;
|
1195 |
-
|
1196 |
const profile = {
|
1197 |
'N (NO3-)': getValue('calculated_no3'),
|
1198 |
'N (NH4+)': getValue('calculated_nh4'),
|
@@ -1256,19 +1255,9 @@ function calculateCationsAndAnions() {
|
|
1256 |
console.log(`Анионы: ${totalAnions.toFixed(2)} mEq/L (${anionPercent}%)`);
|
1257 |
console.log(`Дисбаланс: ${(totalCations - totalAnions).toFixed(2)} mEq/L`);
|
1258 |
|
1259 |
-
//
|
1260 |
-
document.getElementById("n1-value").textContent =
|
1261 |
-
`Катионы: ${totalCations.toFixed(2)} mEq/L | Анионы: ${totalAnions.toFixed(2)} mEq/L`;
|
1262 |
-
|
1263 |
-
|
1264 |
-
document.getElementById("anion-indicator").style.width = `${anionPercent}%`;
|
1265 |
}
|
1266 |
|
1267 |
-
// Добавляем обработчик изменений
|
1268 |
-
document.querySelectorAll('.profile-container input, .nitrogen-container input').forEach(input => {
|
1269 |
-
input.addEventListener('change', calculateCationsAndAnions);
|
1270 |
-
});
|
1271 |
-
|
1272 |
|
1273 |
|
1274 |
|
|
|
1192 |
|
1193 |
// 1. Получаем текущие значения из формы
|
1194 |
const getValue = (id) => parseFloat(document.getElementById(id).value) || 0;
|
|
|
1195 |
const profile = {
|
1196 |
'N (NO3-)': getValue('calculated_no3'),
|
1197 |
'N (NH4+)': getValue('calculated_nh4'),
|
|
|
1255 |
console.log(`Анионы: ${totalAnions.toFixed(2)} mEq/L (${anionPercent}%)`);
|
1256 |
console.log(`Дисбаланс: ${(totalCations - totalAnions).toFixed(2)} mEq/L`);
|
1257 |
|
1258 |
+
// УБРАНО: Обновление интерфейса происходит ТОЛЬКО при явном вызове функции
|
|
|
|
|
|
|
|
|
|
|
1259 |
}
|
1260 |
|
|
|
|
|
|
|
|
|
|
|
1261 |
|
1262 |
|
1263 |
|