From 136220b85a36ebeb1f1cc3598e15297e1275b636 Mon Sep 17 00:00:00 2001
From: ulrich <not disclosed>
Date: Sat, 06 Jan 2018 09:12:30 +0000
Subject: [PATCH] Sender-ID und Klick-Funktion für Senderkacheln hinzugefügt

---
 app.js |   19 ++++++++++++++++---
 1 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/app.js b/app.js
index 718c27d..69bfac2 100644
--- a/app.js
+++ b/app.js
@@ -11,7 +11,12 @@
 function app_init() {
   $('.dialog').hide();
   $('.ost').hide();
-  app_menu_init("data/menu/", "hauptmenue.json", "../jslib/app-menu/app-menu.tpl", ".west", "8em");
+  app_menu_init(
+    "data/menu/",
+    "hauptmenue.json",
+    "../jslib/app-menu/app-menu.tpl",
+    ".west",
+    "8em");
   app_get_template('data/tpl/dlg-msg.tpl', TPL_DLG_MSG);
   app_get_template('data/tpl/dlg-info.tpl', TPL_DLG_INFO);
   app_get_template('data/tpl/sender.tpl', TPL_SENDER);
@@ -39,7 +44,7 @@
 function app_neuer_sender() {
   app_dialog_laden_und_zeigen(templateCache[TPL_DLG_SENDER_NEU], '');
   $('#sender-speichern').on('click', function() {
-    $('#sender-speichern').attr('onclick','').unbind('click');
+    $('#sender-speichern').off('click');
     app_dialog_schliessen();
     app_meldung_mit_timeout('Speichern gewaehlt', 1500);
   });
@@ -74,7 +79,7 @@
 }
 
 function app_dialog_schliessen() {
-  $('.close-btn').attr('onclick','').unbind('click');
+  $('.close-btn').off('click');
   $('.dialog').slideUp(300);
 }
 
@@ -102,6 +107,14 @@
     dataType : "json"
   }).done(function( senderliste ) {
     $(".sender-behaelter").html(Mustache.render(templateCache[TPL_SENDER], senderliste));
+    $('.sender-kachel').on('click', function() {
+      var kachel = $( this );
+      var senderId = kachel.attr("sid");
+      var senderName = $(kachel).find(".sender-name").text();
+      app_meldung_mit_timeout(
+        'Sender ' + senderName + ', ID ' + senderId,
+        1500);
+    });
   });
 }
 

--
Gitblit v1.9.3