From b520d14fa174b912c319cd245edae6620147977a Mon Sep 17 00:00:00 2001 From: ulrich <not disclosed> Date: Fri, 05 Jan 2018 10:48:56 +0000 Subject: [PATCH] Speichern als Dummy in Arbeit --- data/tpl/dlg-sender-edit.tpl | 2 +- app.js | 25 +++++++++++++++++++++---- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/app.js b/app.js index eb7f901..178ee3f 100644 --- a/app.js +++ b/app.js @@ -25,15 +25,24 @@ /* --- Menüfunktionen --- */ function app_nachricht_test() { - app_nachricht_zeigen(templateCache[TPL_DLG_MSG], 'data/msg-test.json'); + app_dialog_laden_und_zeigen(templateCache[TPL_DLG_MSG], 'data/msg-test.json'); } function app_info_dialog_zeigen() { - app_nachricht_zeigen(templateCache[TPL_DLG_INFO], ''); + app_dialog_laden_und_zeigen(templateCache[TPL_DLG_INFO], ''); } function app_neuer_sender() { - app_nachricht_zeigen(templateCache[TPL_DLG_SENDER], ''); + app_dialog_laden_und_zeigen(templateCache[TPL_DLG_SENDER], ''); + $('#sender-speichern').on('click', function() { + $('#sender-speichern').attr('onclick','').unbind('click'); + app_dialog_schliessen(); + $('.sued').text('Speichern gewaehlt'); + setTimeout(function() { + $('.sued').text('Bereit.'); + }, 1500); + }); + app_menu_toggle(); } @@ -42,10 +51,18 @@ function app_dialog_zeigen(vorlage, inhalt) { $(".dialog").html(Mustache.render(vorlage, inhalt)); $(".close-btn").on('click', function() { + app_dialog_schliessen(); + /* $('.close-btn').attr('onclick','').unbind('click'); $('.dialog').slideUp(300); + */ }); $('.dialog').slideDown(300); +} + +function app_dialog_schliessen() { + $('.close-btn').attr('onclick','').unbind('click'); + $('.dialog').slideUp(300); } /* --- Ajax-Aufrufe --- */ @@ -60,7 +77,7 @@ }); } -function app_nachricht_zeigen(vorlage, adresse) { +function app_dialog_laden_und_zeigen(vorlage, adresse) { if(adresse !== '') { $.ajax({ url: adresse, diff --git a/data/tpl/dlg-sender-edit.tpl b/data/tpl/dlg-sender-edit.tpl index b399524..4f4759f 100644 --- a/data/tpl/dlg-sender-edit.tpl +++ b/data/tpl/dlg-sender-edit.tpl @@ -7,7 +7,7 @@ <input id="sender-logo" placeholder="Logo" type="text" class="sender-eingabe"></br> <input id="sender-url" placeholder="URL" type="text" class="sender-eingabe"></br> <div class="form-button-footer"> - <button type="button" id="berechnen">Speichern</button> + <button type="button" id="sender-speichern">Speichern</button> </div> </form> </div> -- Gitblit v1.9.3