From 886e6c7b67168441ea64ac04039c51264453fd77 Mon Sep 17 00:00:00 2001 From: Javier Sánchez Parra Date: Tue, 22 Feb 2022 17:22:07 +0100 Subject: Show selected clients in container block On scopes and commands views, draw clients as users selects them in the scopes tree. Trigger client drawing on two events: 1."change" event, occurs when the user clicks a client checkbox. This event is standard [1]. 2. "show-client" event, fires when ogcp get selected clients from localStorage and when an user checks a parent checkbox. This event is custom. Dot characters (".") in clients names are replaced by underscore("_") when used as id to avoid errors. 1. https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event --- ogcp/templates/macros.html | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'ogcp/templates/macros.html') diff --git a/ogcp/templates/macros.html b/ogcp/templates/macros.html index a1b5ebb..7864cd4 100644 --- a/ogcp/templates/macros.html +++ b/ogcp/templates/macros.html @@ -8,6 +8,7 @@ // in the scope document.addEventListener('readystatechange', () => { if (document.readyState === 'complete') { + showSelectedClientsOnEvents(); updateScopeState(); keepScopesTreeState(); keepSelectedClients(); @@ -47,3 +48,7 @@ {% endfor %} {% endmacro %} + +{% macro selected_clients() -%} +
+{% endmacro %} -- cgit v1.2.3-18-g5258