alecpl
2010-05-17 27480b4a02c88009110b21b02fd5c8c5700e4697
- fix performance of getElementById wrapper for IE (don't look over all elements if initial getElementById returns no element
)


1 files modified
13 ■■■■ changed files
program/js/common.js 13 ●●●● patch | view | raw | blame | history
program/js/common.js
@@ -598,13 +598,14 @@
  document._getElementById = document.getElementById;
  document.getElementById = function(id)
  {
    var i = 0;
    var o = document._getElementById(id);
    var i = 0, obj = document._getElementById(id);
    if (!o || o.id != id)
      while ((o = document.all[i]) && o.id != id)
        i++;
    if (!obj || obj.id == id)
      return obj;
    return o;
    while ((obj = document.all[i]) && obj.id != id)
      i++;
    return obj;
  }
};