Skip to content

Commit

Permalink
fixed recursive function call in IE
Browse files Browse the repository at this point in the history
  • Loading branch information
andyedinborough committed Apr 26, 2011
1 parent 6c3affb commit b06b28d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions stressTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,16 @@ var stressTest = (function () {

//var fid = 0;
function bind(elm, name, func) {
var parts = name.split('.');
var parts = name.split('.'),
_func = !elm.attachEvent ? func : function(){ func.call(elm, window.event); };
if (!elm.__events) elm.__events = {};
if (!elm.__events[name]) elm.__events[name] = [];

if (elm.attachEvent) func = function(){ func.call(elm, window.event); }
//if(!func.id) func.id = fid++;
//log('binding',parts, func, func.id);
elm.__events[name].push(func);
if (elm.attachEvent) elm.attachEvent('on' + parts[0], func);
else if (elm.addEventListener) elm.addEventListener(parts[0], func, true);
elm.__events[name].push(_func);
if (elm.attachEvent) elm.attachEvent('on' + parts[0], _func);
else if (elm.addEventListener) elm.addEventListener(parts[0], _func, true);
}

function unbind(elm, name, func) {
Expand Down

0 comments on commit b06b28d

Please sign in to comment.