From 20f7dfe3340eb1ada7a96e4c24704ecb9445e8d9 Mon Sep 17 00:00:00 2001 From: xue <> Date: Wed, 19 Apr 2006 02:31:18 +0000 Subject: Fixed #137. --- framework/Web/UI/WebControls/TJavascriptLogger.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'framework/Web/UI/WebControls/TJavascriptLogger.php') diff --git a/framework/Web/UI/WebControls/TJavascriptLogger.php b/framework/Web/UI/WebControls/TJavascriptLogger.php index 3196d3b6..0296a276 100644 --- a/framework/Web/UI/WebControls/TJavascriptLogger.php +++ b/framework/Web/UI/WebControls/TJavascriptLogger.php @@ -40,6 +40,15 @@ class TJavascriptLogger extends TWebControl return 'div'; } + /** + * Registers the required logger javascript. + * @param TEventParameter event parameter + */ + public function onPreRender($param) + { + $this->getPage()->getClientScript()->registerPradoScript('logger'); + } + /** * Register the required javascript libraries and * display some general usage information. @@ -47,11 +56,9 @@ class TJavascriptLogger extends TWebControl */ public function renderContents($writer) { - $this->getPage()->getClientScript()->registerPradoScript('logger'); $info = '(more info).'; $usage = 'Press ALT-D (Or CTRL-D on OS X) to toggle the javascript log console'; $writer->write("{$usage} {$info}"); - parent::renderContents($writer); } } -- cgit v1.2.3