summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabio Bas <ctrlaltca@gmail.com>2013-11-23 14:52:22 +0100
committerFabio Bas <ctrlaltca@gmail.com>2013-11-26 11:42:52 +0100
commitc9b49d7de3542ad031b4fe52de93fbaa12c158fd (patch)
treea54b0db74360e046b6d7121617640db6a00968b4
parent808badb68dd02b0fb3977fdcb4f069735e442e50 (diff)
Fixed dynamic creation of js events
-rw-r--r--framework/Web/Javascripts/source/prado/prado.js2
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/ActivePanelTest.page12
2 files changed, 6 insertions, 8 deletions
diff --git a/framework/Web/Javascripts/source/prado/prado.js b/framework/Web/Javascripts/source/prado/prado.js
index 13e8be92..ff147580 100644
--- a/framework/Web/Javascripts/source/prado/prado.js
+++ b/framework/Web/Javascripts/source/prado/prado.js
@@ -388,7 +388,7 @@ Prado.Element =
try
{
eval("(func = function(event){"+value+"})");
- el[attribute] = func;
+ el.get(0)[attribute] = func;
}
catch(e)
{
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActivePanelTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActivePanelTest.page
index 7ab4bab9..13133a32 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/ActivePanelTest.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActivePanelTest.page
@@ -10,13 +10,11 @@
Click Me!
</div>
<script type="text/javascript">
- Event.OnLoad(function()
- {
- Event.observe($("div1"), "click", function()
- {
- Prado.Callback("<%= $this->callback1->UniqueID %>")
- })
- })
+ jQuery( document ).ready(function() {
+ jQuery("#div1").click(function() {
+ Prado.Callback("<%= $this->callback1->UniqueID %>");
+ });
+ });
</script>
<com:TJavascriptLogger />
</com:TForm> \ No newline at end of file