# HG changeset patch # User Michiel Broek # Date 1550696260 -3600 # Node ID c1f2a90c93caff52f2db7bd14d84c59af2cd9cd0 # Parent 60d56f39e63e3bcb290e30f7dcf0e4db4ae516cf Fixed initial display of the yeast propagation window diff -r 60d56f39e63e -r c1f2a90c93ca www/js/prod_edit.js --- a/www/js/prod_edit.js Wed Feb 20 21:39:29 2019 +0100 +++ b/www/js/prod_edit.js Wed Feb 20 21:57:40 2019 +0100 @@ -1825,6 +1825,21 @@ } } + function showStarter() { + + if (dataRecord.starter_enable) { + $("#propagator").show(); + $("#starter_type").jqxDropDownList( {disabled: false }); + $("#starter_try").jqxButton({ disabled: false }); + $("#starter_sg").jqxNumberInput({ spinButtons: true, readOnly: false, width: 110 }); + } else { + $("#propagator").hide(); + $("#starter_type").jqxDropDownList( {disabled: true }); + $("#starter_try").jqxButton({ disabled: true }); + $("#starter_sg").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 }); + } + } + function calcInit () { console.log("calcInit()"); @@ -1834,18 +1849,12 @@ $("#starter_enable").on('checked', function (event) { dataRecord.starter_enable = 1; - $("#propagator").show(); - $("#starter_type").jqxDropDownList( {disabled: false }); - $("#starter_try").jqxButton({ disabled: false }); - $("#starter_sg").jqxNumberInput({ spinButtons: true, readOnly: false, width: 110 }); + showStarter(); calcYeast(); }); $("#starter_enable").on('unchecked', function (event) { dataRecord.starter_enable = 0; - $("#propagator").hide(); - $("#starter_type").jqxDropDownList( {disabled: true }); - $("#starter_try").jqxButton({ disabled: true }); - $("#starter_sg").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 }); + showStarter(); }); $("#starter_try").click(function () { $("#prop1_volume").val(0); @@ -3615,6 +3624,7 @@ }, ready: function() { calcFermentables(); + showStarter(); calcYeast(); $('#jqxTabs').jqxTabs('next'); },