From f9d0c4a3da9d183c90bc7351f233fa67ea3c66a7 Mon Sep 17 00:00:00 2001 From: ulrich@undisclosed Date: Mon, 11 May 2020 07:57:30 +0000 Subject: [PATCH] Auswahl in Nutzerliste --- web/ui2/js/app.js | 18 ++++++++++++++++++ web/ui2/data/tpl/inhalt.tpl | 2 +- web/ui2/stile.css | 6 ++++++ 3 files changed, 25 insertions(+), 1 deletions(-) diff --git a/web/ui2/data/tpl/inhalt.tpl b/web/ui2/data/tpl/inhalt.tpl index f220c80..eea8ab8 100644 --- a/web/ui2/data/tpl/inhalt.tpl +++ b/web/ui2/data/tpl/inhalt.tpl @@ -1,7 +1,7 @@ <div> {{#List}} {{#List}} - <p>{{String}}</p> + <p class="nutzer-liste-eintrag">{{String}}</p> {{/List}} {{/List}} </div> diff --git a/web/ui2/js/app.js b/web/ui2/js/app.js index 07fb0dd..85488db 100644 --- a/web/ui2/js/app.js +++ b/web/ui2/js/app.js @@ -11,6 +11,17 @@ this.datei_neuer_text = function () { self.meldung_mit_timeout("Neuer Text", 1500); }; + + /* Nutzerverwaltung */ + + this.nutzerliste_klick = function(event) { + var target = event.target; + var gewaehlterNutzer = document.querySelector(".nutzer-gewaehlt"); + if(gewaehlterNutzer !== null) { + gewaehlterNutzer.classList.remove("nutzer-gewaehlt"); + } + target.classList.add("nutzer-gewaehlt"); + }; /* Funktionen aus App-Vorlage */ @@ -149,6 +160,13 @@ function (h) { var elem = document.getElementById('nutzer'); elem.innerHTML = h; + + var absaetze = document.querySelectorAll('p.nutzer-liste-eintrag'); + var index; + for (index = 0; index < absaetze.length; index++) { + absaetze[index].addEventListener("click", self.nutzerliste_klick); + } + }); }); }; diff --git a/web/ui2/stile.css b/web/ui2/stile.css index 304cfd7..cb4abb0 100644 --- a/web/ui2/stile.css +++ b/web/ui2/stile.css @@ -158,6 +158,12 @@ color: #b8b8b8; } +/* Nutzerliste */ + +.nutzer-gewaehlt { + background-color: lightsteelblue; +} + /* für app-menu */ -- Gitblit v1.9.3