1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-14 05:25:56 +00:00

easier user privilege editor, misc js cleanups

This commit is contained in:
Andrew Dolgov
2006-03-20 15:12:41 +01:00
parent c38c2b69c9
commit 5917a8e4a7
4 changed files with 43 additions and 19 deletions

View File

@@ -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);
}
}