diff options
author | Javier Hernandez <jhernandez@soleta.eu> | 2024-01-11 13:36:19 +0100 |
---|---|---|
committer | OpenGnSys Support Team <soporte-og@soleta.eu> | 2024-01-11 13:36:19 +0100 |
commit | cba7a0c1c617e1039055652318c11f309eda932f (patch) | |
tree | 0c5424dd702c735f3757a73408a51b21dfc0a65e /ogcp/static | |
parent | 2509cacc005832b37e181f6a6a4795f5c7e1fff9 (diff) |
views: Add computers to folder
Add support for adding computers to a folder.
It uses a js script that when selecting a folder in the html form, it
will also select the parent of the folder. For instance, if the user
were to select a folder that is contained inside a room, the room would
also get selected. This allows the view to know which parent contains
the folder.
Diffstat (limited to 'ogcp/static')
-rw-r--r-- | ogcp/static/js/ogcp.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ogcp/static/js/ogcp.js b/ogcp/static/js/ogcp.js index 964e68d..ccd8a1e 100644 --- a/ogcp/static/js/ogcp.js +++ b/ogcp/static/js/ogcp.js @@ -374,6 +374,14 @@ function checkRepoServer() { }); } +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); + }); +} + function limitCheckboxes() { const checkboxes = $('input:checkbox[form|="scopesForm"]'); |