X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=js%2Futils.js;h=761378e4c4ddcf22df2f371d7414ae50559616be;hb=f1d9197ac11b9b063941ec7f0c4071607fa81519;hp=a801a13ecd59ae1c81e1e9c01161510963a3ed54;hpb=7eb0da506fb25d46c9c63132dc42f5f5b31222c0;p=fa-stable.git diff --git a/js/utils.js b/js/utils.js index a801a13e..761378e4 100644 --- a/js/utils.js +++ b/js/utils.js @@ -119,7 +119,7 @@ JsHttpRequest._request = function(trigger, form, tout, retry) { } else if(cmd=='fc') { // set focus _focus = data; } else if(cmd=='js') { // evaluate js code - eval(data); + __isGecko ? eval(data) : setTimeout(function(){eval(data)}, 200); // timeout required by IE7/8 } else if(cmd=='rd') { // client-side redirection window.location = data; } else if(cmd=='pu') { // pop-up @@ -317,7 +317,7 @@ function move_focus(dir, e0, neighbours) return t; } -var __isFireFox = navigator.userAgent.match(/gecko/i); +var __isGecko = navigator.userAgent.match(/gecko/i); // i.e. Gecko or KHTML, like Gecko ;) //returns the absolute position of some element within document function element_pos(e) { var res = new Object(); @@ -337,7 +337,7 @@ function element_pos(e) { res.y -= offsetParent.scrollTop; } //next lines are necessary to support FireFox problem with offsetParent - if (__isFireFox) { + if (__isGecko) { while (offsetParent != parentNode && parentNode !== null) { res.x -= parentNode.scrollLeft; res.y -= parentNode.scrollTop; @@ -352,4 +352,4 @@ function element_pos(e) { // parentNode has style.display set to none if (parentNode != document.documentElement) return null; return res; -} \ No newline at end of file +}