From d548e1e9a72fc7868d4086faa6b910443faaeb6d Mon Sep 17 00:00:00 2001 From: Orslumen Date: Fri, 8 Apr 2011 15:37:21 +0200 Subject: [PATCH] https://github.com/envjs/env-js/issues/19: Looks like the MouseEvents are not bound --- envjs/event.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/envjs/event.js b/envjs/event.js index dfb3f6a3..19fde3f2 100644 --- a/envjs/event.js +++ b/envjs/event.js @@ -203,9 +203,9 @@ __dispatchEvent__ = function(target, event, bubbles){ if ((typeof target.getAttribute === 'function') && target.getAttribute("on" + event.type)) { script = target.getAttribute("on" + event.type); // return is not allowed within __eval__, so I am adding a temporary function around it - script = script.replace('javascript:', 'javascript:document._tmp_on_event = function(){ ')+"}"; + script = 'document._tmp_on_event = function(args){ ' + script.replace('javascript:', '') + ' }'; var tmp_function = eval(script); - var returnValue = tmp_function(); + var returnValue = tmp_function.apply(target, [event]); if(returnValue === false){ event.stopPropagation(); }