summaryrefslogtreecommitdiff
path: root/framework/Web/Javascripts
diff options
context:
space:
mode:
authorFabio Bas <ctrlaltca@gmail.com>2013-11-03 19:33:34 +0100
committerFabio Bas <ctrlaltca@gmail.com>2013-11-03 19:33:34 +0100
commit6801f262e4955fcb7fa48bc88ef64df786f0c650 (patch)
tree57c655ae46e22964c8cb535a3ed171aef39e867a /framework/Web/Javascripts
parent208bfe86ad99553300ec77a82337a61758ca3f03 (diff)
Fixed evaluation of end-scripts on callback
Aka: fix js event creation on callbacks
Diffstat (limited to 'framework/Web/Javascripts')
-rw-r--r--framework/Web/Javascripts/TJavaScript.php13
-rw-r--r--framework/Web/Javascripts/source/prado/prado.js10
2 files changed, 22 insertions, 1 deletions
diff --git a/framework/Web/Javascripts/TJavaScript.php b/framework/Web/Javascripts/TJavaScript.php
index 0f6fef1c..8cfbc9ba 100644
--- a/framework/Web/Javascripts/TJavaScript.php
+++ b/framework/Web/Javascripts/TJavaScript.php
@@ -60,6 +60,19 @@ class TJavaScript
}
/**
+ * Renders a list of javascript code
+ * @param array javascript blocks
+ * @return string rendering result
+ */
+ public static function renderScriptBlocksCallback($scripts)
+ {
+ if(count($scripts))
+ return implode("\n",$scripts)."\n";
+ else
+ return '';
+ }
+
+ /**
* Renders javascript block
* @param string javascript block
* @return string rendering result
diff --git a/framework/Web/Javascripts/source/prado/prado.js b/framework/Web/Javascripts/source/prado/prado.js
index 6cc30c2c..25550bca 100644
--- a/framework/Web/Javascripts/source/prado/prado.js
+++ b/framework/Web/Javascripts/source/prado/prado.js
@@ -524,9 +524,17 @@ Prado.Element =
* Evaluate a javascript snippet from a string.
* @function ?
* @param {string} content - String containing the script
+ * @param {string} boundary - Boundary containing the script
*/
- evaluateScript : function(content)
+ evaluateScript : function(content, boundary)
{
+ if(boundary)
+ {
+ var result = this.extractContent(boundary);
+ if(result != null)
+ content = result;
+ }
+
try
{
jQuery.globalEval(content);