From e3c1508dd215fb289f705cc3d0c41bbe28bb942a Mon Sep 17 00:00:00 2001
From: ulrich
Date: Wed, 30 Dec 2020 16:08:20 +0000
Subject: [PATCH] fonts verweis geaendert

---
 web/ui/js/app.js |   55 +++++++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 47 insertions(+), 8 deletions(-)

diff --git a/web/ui/js/app.js b/web/ui/js/app.js
index fbbf052..b953014 100644
--- a/web/ui/js/app.js
+++ b/web/ui/js/app.js
@@ -11,6 +11,7 @@
     document.querySelector('#top-logout-btn').addEventListener('click', self.logout);
     document.querySelector('.west').style.flexBasis = '0em';
     document.querySelector('.ost').style.flexBasis = '0em';
+    self.zurueck_btn_aus();
     self.get_login();
     self.get_user_list();
   };
@@ -18,12 +19,27 @@
   /* Nutzerverwaltung */
   
   this.nutzer_neu_dialog_zeigen = function () {
+    self.html_erzeugen(
+      'data/tpl/dlg-nutzer-neu.tpl',
+      '',
+      function (html) {
+        document.querySelector("#nutzer").innerHTML = html;        
+        var btn = document.getElementById('nutzer-speichern-btn');
+        if(btn !== null) {
+          btn.addEventListener('click', self.nutzer_speichern);                         
+        }                      
+        self.zurueck_btn_ein(self.zurueck_zu_user_liste);
+      }
+    );
+
+    /*
     self.dialog_zeigen('data/tpl/dlg-nutzer-neu.tpl', '', function(){
       var btn = document.getElementById('nutzer-speichern-btn');
       if(btn !== null) {
         btn.addEventListener('click', self.nutzer_speichern);                         
       }                      
     });
+    */
   };
 
   this.nutzerliste_klick = function(event) {
@@ -87,7 +103,7 @@
           self.alle_rollen_zeigen();
         });
     });
-    document.querySelector('.zurueck-btn').style.color = 'black';
+    //document.querySelector('.zurueck-btn').style.color = 'black';
   };
   
   this.nutzer_loeschen_bestaetigen = function() {
@@ -106,6 +122,11 @@
       });
   };
   
+  this.zurueck_zu_user_liste = function() {
+    self.zurueck_btn_aus(self.zurueck_zu_user_liste);
+    self.get_user_list();
+  };
+  
   this.alle_rollen_zeigen = function() {
     var m = 'getRoleNamesGranted';
     var u = '../svc/' + m;
@@ -115,9 +136,12 @@
         JSON.parse(antwort2),
         function (html) {
           document.querySelector(".alle-rollen-behaelter").innerHTML = html;
+          self.zurueck_btn_ein(self.zurueck_zu_user_liste);
+          /*
           document.querySelector('.zurueck-btn').addEventListener('click', function (e) {
             self.get_user_list();
           });
+          */
           self.addEvtListener('.avl-role-btn', 'click', self.grant_role_klick);
         });
     });
@@ -240,7 +264,7 @@
             vurl,
             inhalt,
             function (html) {
-              dlg.style.flexBasis = '18em';
+              dlg.style.flexBasis = '9em';
               setTimeout(function () {
                 dlg.innerHTML = html;
                 document.querySelector('.close-btn').addEventListener(
@@ -273,7 +297,7 @@
           var elem = document.getElementById('nutzer');
           elem.innerHTML = h;
           self.addEvtListener('p.nutzer-liste-eintrag', 'click', self.nutzerliste_klick);
-          document.querySelector('.zurueck-btn').style.color = '#eee';
+          //document.querySelector('.zurueck-btn').style.color = '#eee';
           self.removeAllListeners('top-neu-btn'); 
           var topBtn = document.querySelector('#top-neu-btn');
           topBtn.title = "Neuer Benutzer";
@@ -288,7 +312,8 @@
       self.get_user_list();
       document.getElementById('nutzer-speichern-btn').removeEventListener(
         'click', self.nutzer_speichern);
-      self.dialog_schliessen();
+      //self.dialog_schliessen();
+      self.zurueck_zu_user_liste();
     });
   };
 
@@ -328,7 +353,7 @@
     var u = '../pub' + m;
     self.http_get(u, function (resp) {
       //$('#userMenu').text('nicht angemeldet');
-      window.location.href = '../logout.jsp';
+      window.location.href = '../logout.html';
     });
   };
 
@@ -359,7 +384,21 @@
     }
   };
   
-/* ----- Hilfsfunktionen ----- */
+  /* ---- Steuerung Bedienelemente ---- */
+  
+  this.zurueck_btn_ein = function(callback) {
+    var btn = document.querySelector('.zurueck-btn');
+    btn.addEventListener('click', callback);
+    btn.style.color = 'black';
+  };
+  
+  this.zurueck_btn_aus = function(listener) {
+    var btn = document.querySelector('.zurueck-btn');
+    btn.removeEventListener('click', listener);
+    btn.style.color = '#eee';    
+  };
+    
+  /* ----- Hilfsfunktionen ----- */
 
   this.serialisieren = function(obj) {
     return '{"' + obj.constructor.name + '":' + JSON.stringify(obj) + '}';
@@ -373,8 +412,8 @@
     }
   };
   
-  this.removeAllListeners = function(elementId) {
-    var el = document.getElementById(elementId);
+  this.removeAllListeners = function(id) {
+    var el = document.getElementById(id);
     elClone = el.cloneNode(true);
     el.parentNode.replaceChild(elClone, el);
   }; // https://stackoverflow.com/questions/19469881/remove-all-event-listeners-of-specific-type

--
Gitblit v1.9.3