From 0153b2b13fd0e28753646fe0ca961e8cae931d26 Mon Sep 17 00:00:00 2001 From: Alejandro Sirgo Rica Date: Wed, 12 Jun 2024 14:55:27 +0200 Subject: js: uncheck parent folder when a child folder is unchecked Improve selection logic to deselect the checkbox of a folder's parent when the checkbox is unchecked. Based on work from Javier Hernandez. --- ogcp/static/js/ogcp.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ogcp') diff --git a/ogcp/static/js/ogcp.js b/ogcp/static/js/ogcp.js index 8916353..17d3ca0 100644 --- a/ogcp/static/js/ogcp.js +++ b/ogcp/static/js/ogcp.js @@ -388,7 +388,7 @@ function checkFolderParent() { const folder = $('input:checkbox[form|="scopesForm"][name="folder"]') folder.on('change', function() { const folder_parent = $('#' + $.escapeSelector(this.dataset.parentInput)); - folder_parent.prop('checked', true); + folder_parent.prop('checked', this.checked); }); } -- cgit v1.2.3-18-g5258