summaryrefslogtreecommitdiff
path: root/lib/scripts/script.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/scripts/script.js')
-rw-r--r--lib/scripts/script.js16
1 files changed, 7 insertions, 9 deletions
diff --git a/lib/scripts/script.js b/lib/scripts/script.js
index bf6f41ce5..27d088584 100644
--- a/lib/scripts/script.js
+++ b/lib/scripts/script.js
@@ -78,16 +78,15 @@ function getElementsByClass(searchClass,node,tag) {
/**
* Get the X offset of the top left corner of the given object
*
- * @link http://www.quirksmode.org/index.html?/js/findpos.html
+ * @link http://www.quirksmode.org/js/findpos.html
*/
function findPosX(object){
var curleft = 0;
var obj = $(object);
if (obj.offsetParent){
- while (obj.offsetParent){
+ do {
curleft += obj.offsetLeft;
- obj = obj.offsetParent;
- }
+ } while (obj = obj.offsetParent);
}
else if (obj.x){
curleft += obj.x;
@@ -98,16 +97,15 @@ function findPosX(object){
/**
* Get the Y offset of the top left corner of the given object
*
- * @link http://www.quirksmode.org/index.html?/js/findpos.html
+ * @link http://www.quirksmode.org/js/findpos.html
*/
function findPosY(object){
var curtop = 0;
var obj = $(object);
if (obj.offsetParent){
- while (obj.offsetParent){
+ do {
curtop += obj.offsetTop;
- obj = obj.offsetParent;
- }
+ } while (obj = obj.offsetParent);
}
else if (obj.y){
curtop += obj.y;
@@ -535,7 +533,7 @@ addInitEvent(function(){
var btns = getElementsByClass('btn_secedit',document,'form');
for(var i=0; i<btns.length; i++){
addEvent(btns[i],'mouseover',function(e){
- var tgt = e.target.form.parentNode;
+ var tgt = this.parentNode;
var nr = tgt.className.match(/(\s+|^)editbutton_(\d+)(\s+|$)/)[2];
do {
tgt = tgt.previousSibling;