www/js/profile_fermentation.js

changeset 494
af28ebe4a779
parent 487
06df1320327c
child 523
3cccf4392a25
--- a/www/js/profile_fermentation.js	Fri Sep 13 23:02:38 2019 +0200
+++ b/www/js/profile_fermentation.js	Sat Sep 14 19:04:29 2019 +0200
@@ -121,10 +121,11 @@
 			});
 		}
 	},
-	dataAdapter = new $.jqx.dataAdapter(source);
+	dataAdapter = new $.jqx.dataAdapter(source),
+	editrow = -1,
 
 	// Inline steps editor
-	var editsteps = function (data) {
+	editsteps = function (data) {
 		var generaterow = function () {
 			var row = {};
 			row["name"] = "Stap 1";
@@ -134,8 +135,8 @@
 			row['target_hi'] = 23.0;
 			row['fridgemode'] = 0;
 			return row;
-		}
-		var stepSource = {
+		},
+		stepSource = {
 			localdata: data.steps,
 			datatype: "local",
 			datafields: [
@@ -177,10 +178,11 @@
 				});
 				// delete row.
 				$("#deleterowbutton").on('click', function () {
-					var selectedrowindex = $("#grid").jqxGrid('getselectedrowindex');
-					var rowscount = $("#grid").jqxGrid('getdatainformation').rowscount;
+					var selectedrowindex = $("#grid").jqxGrid('getselectedrowindex'),
+					rowscount = $("#grid").jqxGrid('getdatainformation').rowscount,
+					id;
 					if (selectedrowindex >= 0 && selectedrowindex < rowscount) {
-						var id = $("#grid").jqxGrid('getrowid', selectedrowindex);
+						id = $("#grid").jqxGrid('getrowid', selectedrowindex);
 						$("#grid").jqxGrid('deleterow', id);
 					}
 				});
@@ -232,7 +234,6 @@
 	$("#inittemp_hi").jqxNumberInput({ max: 40 });
 	$("#fridgemode").jqxCheckBox({ theme: theme, height: 23, enableContainerClick: false });
 
-	var editrow = -1;
 	// initialize jqxGrid
 	$("#jqxgrid").jqxGrid({
 		width: 1280,

mercurial