summaryrefslogtreecommitdiff
path: root/roundcubemail/program/js
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-05-17 09:07:31 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-05-17 09:07:31 +0000
commitff1de7b1463060873dd1d03eb6e2ae8bdf60455f (patch)
tree744dbf034d22a1f27e5b1f465b88da3f57417257 /roundcubemail/program/js
parent6560226ff5892a51104da0f992a012528a48ac14 (diff)
- fix performance of getElementById wrapper for IE (don't look over all elements if initial getElementById returns no element
) git-svn-id: https://svn.roundcube.net/trunk@3623 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/js')
-rw-r--r--roundcubemail/program/js/common.js13
1 files changed, 7 insertions, 6 deletions
diff --git a/roundcubemail/program/js/common.js b/roundcubemail/program/js/common.js
index 69a2d579e..7ef183c93 100644
--- a/roundcubemail/program/js/common.js
+++ b/roundcubemail/program/js/common.js
@@ -598,13 +598,14 @@ if (bw.ie)
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;
}
};