From faab2d0597940dfa742c3c105a3b607ccf75e8d6 Mon Sep 17 00:00:00 2001
From: ulrich
Date: Tue, 06 Apr 2021 11:43:19 +0000
Subject: [PATCH] Ablageorte fertig

---
 www/ui/app.css                      |   33 ++++++++++++++++++++++++++-------
 www/ui/data/menu/hauptmenue.json    |    5 -----
 www/ui/data/tpl/ablageort_liste.tpl |    5 ++++-
 www/ui/js/app.js                    |    8 ++++++++
 4 files changed, 38 insertions(+), 13 deletions(-)

diff --git a/www/ui/app.css b/www/ui/app.css
index e2ac5ca..7348b8f 100644
--- a/www/ui/app.css
+++ b/www/ui/app.css
@@ -35,7 +35,7 @@
   flex-grow: 0;
   flex-shrink: 0;
   flex-basis: 4em;
-  background-color: white;
+  background-color: #ececec; /* white; */
   transition: all 0.3s ease-in;
   overflow: hidden;
   white-space: nowrap;
@@ -61,6 +61,7 @@
   overflow-x: hidden;
   overflow-y: auto;
   -webkit-overflow-scrolling: touch;
+  background-color: white;
 }
 
 .zentraler-inhalt {
@@ -96,7 +97,7 @@
 }
 
 .dlg-info {
-  background-color: #dcf2fb; // blau
+  background-color: #dcf2fb; /* blau */
   padding: 0.4em;
 }
 
@@ -125,8 +126,24 @@
   flex-flow: column;
 }
 
+.entity-liste-kopf {
+  display: flex;
+  flex-flow: row;
+  justify-content: space-between;
+  vertical-align: middle;
+}
+
+.entity-liste-kopf .button {
+  /* margin-left: 1rem; */
+  /* margin-top: -0.2rem; */
+}
+
 .entity-element {
   margin: 0.4rem;
+}
+
+.entity-element:hover {
+  background-color: background;
 }
 
 .entity-liste {
@@ -138,6 +155,11 @@
   margin-left: 0;
   margin-right: 0;
   margin-bottom: 0;
+  cursor: pointer;
+}
+
+.entity-eintrag:hover {
+  background-color: background;
 }
 
 .form-button-footer {
@@ -149,12 +171,9 @@
   margin-left: 0.4rem;
 }
 
-/*
+
 @media (min-width: 800px) {
-  .zentrum-behaelter {
-    padding: 0 1em 0 1em;
-  }
-  .zentrum-behaelter, .nord {
+  .zentraler-inhalt {
     margin: 0 10% 0 10%;
   }
 }
diff --git a/www/ui/data/menu/hauptmenue.json b/www/ui/data/menu/hauptmenue.json
index 7208336..18733f9 100644
--- a/www/ui/data/menu/hauptmenue.json
+++ b/www/ui/data/menu/hauptmenue.json
@@ -13,11 +13,6 @@
         "funktion": "app.ablageort_liste"
       },
       {
-        "titel": "Neuer Ablageort",
-        "umenue": false,
-        "funktion": "app.ablageort_form"
-      },
-      {
         "titel": "Seite umschalten",
         "umenue": false,
         "funktion": "app.seitenleiste_umschalten"
diff --git a/www/ui/data/tpl/ablageort_liste.tpl b/www/ui/data/tpl/ablageort_liste.tpl
index b86452d..16f1f32 100644
--- a/www/ui/data/tpl/ablageort_liste.tpl
+++ b/www/ui/data/tpl/ablageort_liste.tpl
@@ -1,6 +1,9 @@
 
 <div class='entity-formular'>
-  Ablageorte     
+  <div class='entity-liste-kopf'>
+    Ablageorte     
+    <button class='button' id='neu-btn'>Neu</button>
+  </div>
   <ul class='entity-liste'>
     {{#ArrayList}}
     <li class='entity-eintrag'>{{.}}</li>
diff --git a/www/ui/js/app.js b/www/ui/js/app.js
index 691185d..7585753 100644
--- a/www/ui/js/app.js
+++ b/www/ui/js/app.js
@@ -22,6 +22,9 @@
             self.ablageort_form(ablageort);
           });
         });
+        self.addEvtListener('#neu-btn', 'click', function (event) {
+          eval("self.ablageort_form" + "(this)");
+        });        
       });
     });
   };
@@ -58,9 +61,11 @@
           });
         }
         document.querySelector(".zentraler-inhalt").innerHTML = '';
+        self.ablageort_liste();
       });
       self.addEvtListener('#cancel-btn', 'click', function () {
         document.querySelector(".zentraler-inhalt").innerHTML = '';
+        self.ablageort_liste();
       });
       self.addEvtListener('#loeschen-btn', 'click', function() {
         var aoname = document.querySelector('#ablageort-name').value;
@@ -72,6 +77,7 @@
               // hier die Antwort verarbeiten
               self.dialog_schliessen();
               document.querySelector(".zentraler-inhalt").innerHTML = '';
+              self.ablageort_liste();
             });
           });
         });
@@ -87,6 +93,8 @@
     }
   };
 
+  /* asynchroner HTTP Client */
+  
   this.http_get = function (u, cb) {
     self.http_call('GET', u, null, cb);
   };

--
Gitblit v1.9.3