From: Moritz Bunkus Date: Fri, 13 Jan 2017 13:11:19 +0000 (+0100) Subject: kivi.history_back: wie history.back() aber über kivi.get_function_by_name auffindbar X-Git-Tag: release-3.5.4~1714 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=4cde51b98c34657c2540f08fb55b5ed28c314d06;p=kivitendo-erp.git kivi.history_back: wie history.back() aber über kivi.get_function_by_name auffindbar --- diff --git a/js/kivi.js b/js/kivi.js index e05ea88f7..27077575d 100644 --- a/js/kivi.js +++ b/js/kivi.js @@ -305,6 +305,14 @@ namespace("kivi", function(ns) { $form.submit(); }; + // This function exists solely so that it can be found with + // kivi.get_functions_by_name() and called later on. Using something + // like "var func = history["back"]" works, but calling it later + // with "func.apply()" doesn't. + ns.history_back = function() { + history.back(); + }; + // Return a function object by its name (a string). Works both with // global functions (e.g. "check_right_date_format") and those in // namespaces (e.g. "kivi.t8").