Overview
Comment:Don't show as disabled the other column field, as it can lead to the feeling that it can't be changed
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | stable
Files: files | file ages | folders
SHA1: 985f99d145f39a88c95d6e0315fcf42fff57e17c
User & Date: bohwaz on 2020-12-18 21:17:53
Other Links: manifest | tags
Context
2020-12-20
16:56
Fix import of transactions check-in: 026dee2dda user: bohwaz tags: trunk, stable
2020-12-18
21:17
Don't show as disabled the other column field, as it can lead to the feeling that it can't be changed check-in: 985f99d145 user: bohwaz tags: trunk, stable
14:52
Make sure that all values are filled check-in: 0eeee9611e user: bohwaz tags: trunk, stable
Changes

Modified src/www/admin/static/scripts/accounting.js from [da216bc624] to [f16f1d5eef].

36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
		// Update totals and disable other amount input
		var inputs = row.querySelectorAll('input.money');

		inputs.forEach((i, k) => {
			i.onkeyup = (e) => {
				var v = i.value.replace(/[^0-9,.]/);
				if (v.length && v != 0) {
					i.classList.remove('disabled');
					inputs[+!k].classList.add('disabled');
					inputs[+!k].value = '0';
					updateTotals();
				}
			};

			if (+i.value == 0 && +inputs[+!k].value != 0) {
				i.classList.add('disabled');
				i.value = '0';
			}
		});
	}

	lines.forEach(initLine);








<
<






<







36
37
38
39
40
41
42


43
44
45
46
47
48

49
50
51
52
53
54
55
		// Update totals and disable other amount input
		var inputs = row.querySelectorAll('input.money');

		inputs.forEach((i, k) => {
			i.onkeyup = (e) => {
				var v = i.value.replace(/[^0-9,.]/);
				if (v.length && v != 0) {


					inputs[+!k].value = '0';
					updateTotals();
				}
			};

			if (+i.value == 0 && +inputs[+!k].value != 0) {

				i.value = '0';
			}
		});
	}

	lines.forEach(initLine);