summaryrefslogtreecommitdiff
path: root/functions.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2006-03-20 15:12:41 +0100
committerAndrew Dolgov <[email protected]>2006-03-20 15:12:41 +0100
commit5917a8e4a7549dd708521ca8b96134674c35e3b6 (patch)
treee4180f69fdd26fb0e3cb4fc092ddbed519951cdf /functions.js
parentc38c2b69c9479817291ac06042fb5529b24f33f0 (diff)
easier user privilege editor, misc js cleanups
Diffstat (limited to 'functions.js')
-rw-r--r--functions.js28
1 files changed, 16 insertions, 12 deletions
diff --git a/functions.js b/functions.js
index 92bcc3bf9..1d45b1cbf 100644
--- a/functions.js
+++ b/functions.js
@@ -870,18 +870,22 @@ function leading_zero(p) {
}
function center_element(e) {
- var c_width = document.body.clientWidth;
- var c_height = document.body.clientHeight;
- var c_scroll = document.body.scrollTop;
-
- var e_width = e.clientWidth;
- var e_height = e.clientHeight;
-
- var set_y = (c_height / 2) + c_scroll - (e_height / 2);
- var set_x = (c_width / 2) - (e_width / 2);
-
- e.style.top = set_y + "px";
- e.style.left = set_x + "px";
+ try {
+ var c_width = document.body.clientWidth;
+ var c_height = document.body.clientHeight;
+
+ var c_scroll = document.body.scrollTop;
+ var e_width = e.clientWidth;
+ var e_height = e.clientHeight;
+
+ var set_y = (c_height / 2) + c_scroll - (e_height / 2);
+ var set_x = (c_width / 2) - (e_width / 2);
+
+ e.style.top = set_y + "px";
+ e.style.left = set_x + "px";
+ } catch (e) {
+ exception_error("center_element", e);
+ }
}