From 4cde51b98c34657c2540f08fb55b5ed28c314d06 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Fri, 13 Jan 2017 14:11:19 +0100 Subject: [PATCH] =?utf8?q?kivi.history=5Fback:=20wie=20history.back()=20ab?= =?utf8?q?er=20=C3=BCber=20kivi.get=5Ffunction=5Fby=5Fname=20auffindbar?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- js/kivi.js | 8 ++++++++ 1 file changed, 8 insertions(+) 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"). -- 2.20.1