Skip to content

Commit

Permalink
envjs#19: Looks like the MouseEvents are not bound
Browse files Browse the repository at this point in the history
  • Loading branch information
orslumen committed Apr 8, 2011
1 parent fe499c2 commit d548e1e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions envjs/event.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit d548e1e

Please sign in to comment.