From: Moritz Bunkus Date: Mon, 9 Jan 2017 15:37:07 +0000 (+0100) Subject: kivi.popup_dialog: neuer Callback »load« nach erfolgreichem AJAX-Laden des Inhalts X-Git-Tag: release-3.5.4~1757 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=44d38b2b8d020b9f223723afb2faefcd487b9c60;p=kivitendo-erp.git kivi.popup_dialog: neuer Callback »load« nach erfolgreichem AJAX-Laden des Inhalts --- diff --git a/js/kivi.js b/js/kivi.js index c935c34cd..c456bd71d 100644 --- a/js/kivi.js +++ b/js/kivi.js @@ -307,6 +307,7 @@ namespace("kivi", function(ns) { // - id: dialog DIV ID (optional; defaults to 'jqueryui_popup_dialog') // - url, data, type: passed as the first three arguments to the $.ajax() call if an AJAX call is made, otherwise ignored. // - dialog: an optional object of options passed to the $.dialog() call + // - load: an optional function that is called after the content has been loaded successfully (only if an AJAX call is made) ns.popup_dialog = function(params) { var dialog; @@ -360,6 +361,8 @@ namespace("kivi", function(ns) { success: function(new_html) { dialog.html(new_html); dialog.removeClass('loading'); + if (params.load) + params.load(); } }); }