From bdbb0737d6aed864361c85de546227188fb88d94 Mon Sep 17 00:00:00 2001 From: ulrich <not disclosed> Date: Sat, 27 Jan 2018 13:20:38 +0000 Subject: [PATCH] Sender loeschen --- data/tpl/dlg-sender-edit.tpl | 4 +++- app.js | 19 ++++++++++++++++++- data/tpl/dlg-sender-loeschen.tpl | 11 +++++++++++ 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/app.js b/app.js index d442e63..80a295c 100644 --- a/app.js +++ b/app.js @@ -5,6 +5,7 @@ var TPL_DLG_INFO = 'dlg-info'; var TPL_DLG_SENDER_NEU = 'dlg-sender-neu'; var TPL_DLG_SENDER_EDIT = 'dlg-sender-edit'; +var TPL_DLG_SENDER_DEL = 'dlg-sender-del'; var TPL_SENDER_EDIT_FORM = 'sender-edit-form'; var TPL_SENDER_KACHEL = 'sender-kachel'; var TPL_ABSPIELER = 'abspieler'; @@ -37,6 +38,7 @@ app_get_template('data/tpl/sender.tpl', TPL_SENDER); app_get_template('data/tpl/dlg-sender-neu.tpl', TPL_DLG_SENDER_NEU); app_get_template('data/tpl/dlg-sender-edit.tpl', TPL_DLG_SENDER_EDIT); + app_get_template('data/tpl/dlg-sender-loeschen.tpl', TPL_DLG_SENDER_DEL); app_get_template('data/tpl/dlg-sender-edit-form.tpl', TPL_SENDER_EDIT_FORM); app_get_template('data/tpl/kachel.tpl', TPL_SENDER_KACHEL); app_get_template('data/tpl/abspieler.tpl', TPL_ABSPIELER); @@ -155,6 +157,10 @@ kachel.on('click', app_kachel_klick); } +function app_kachel_entfernen(sender) { + $( "div[sid='" + sender.id + "']" ).remove(); +} + function app_kachel_klick() { var kachel = $( this ); var senderId = kachel.attr("sid"); @@ -178,6 +184,16 @@ }); break; case "3": + $(".dlg-behaelter").html( + Mustache.render(templateCache[TPL_DLG_SENDER_DEL], s) + ); + $('#sender-loeschen').on('click', function() { + $('#sender-loeschen').off('click'); + app_kachel_entfernen(s); + app_dialog_schliessen(); + app_meldung_mit_timeout('Loeschen gewaehlt ' + s.name, 1500); + }); + app_menue_umschalten(); break; default: app_meldung_mit_timeout( @@ -219,7 +235,8 @@ } function app_sender_loeschen() { - app_meldung_mit_timeout('Nicht implementiert: Sender loeschen.', 1500); + senderKlickModus = "3"; // loeschen + app_dialog_laden_und_zeigen(templateCache[TPL_DLG_SENDER_EDIT], ''); app_menue_umschalten(); } diff --git a/data/tpl/dlg-sender-edit.tpl b/data/tpl/dlg-sender-edit.tpl index 523dc6a..15ee980 100644 --- a/data/tpl/dlg-sender-edit.tpl +++ b/data/tpl/dlg-sender-edit.tpl @@ -1,6 +1,8 @@ <div class="dlg-sender-edit"> <span class="close-btn pointer-cursor">✖</span> <div class="dlg-behaelter"> - <div class="dlg-sender-text">Sender zum Bearbeiten antippen...</div> + <div class="dlg-sender-text"> + Sender zum Bearbeiten oder Löschen antippen... + </div> </div> </div> diff --git a/data/tpl/dlg-sender-loeschen.tpl b/data/tpl/dlg-sender-loeschen.tpl new file mode 100644 index 0000000..176d2a9 --- /dev/null +++ b/data/tpl/dlg-sender-loeschen.tpl @@ -0,0 +1,11 @@ +<div class="nachricht"> + <span class="close-btn pointer-cursor">✖</span> + <div class="dlg-behaelter"> + <div class="dlg-info-app-info"> + Wollen Sie den Sender {{name}} wirklich löschen? + </div> + <div class="form-button-footer"> + <button type="button" id="sender-loeschen">Löschen</button> + </div> + </div> +</div> -- Gitblit v1.9.3