includes/clientside/sbedit.js
changeset 80 cb7dde69c301
parent 1 fe660c52c48f
child 190 e858bacb5cfa
--- a/includes/clientside/sbedit.js	Mon Jul 30 10:46:17 2007 -0400
+++ b/includes/clientside/sbedit.js	Wed Aug 01 13:39:27 2007 -0400
@@ -60,10 +60,10 @@
         var thediv = document.createElement('div');
         //if(!oElm.id) oElm.id = 'autoEditButton_'+Math.floor(Math.random() * 100000);
         oElm = oElm.parentNode;
-        o = fetch_offset(oElm);
-        d = fetch_dimensions(oElm);
-        top = o['top'] + d['h'] + 'px';
-        left = o['left'] + 'px';
+        var magic = $(oElm).Top() + $(oElm).Height();
+        var top = String(magic);
+        top = top + 'px';
+        left = $(oElm).Left() + 'px';
         thediv.style.top = top;
         thediv.style.left = left;
         thediv.style.position = 'absolute';
@@ -107,10 +107,13 @@
         eval(ajax.responseText);
         if(status == 'GOOD')
         {
-          parent = document.getElementById('disabled_'+id).parentNode.parentNode;
+          var _id = 'disabled_' + String(id);
+          var parent = document.getElementById(_id).parentNode.parentNode;
           oElm.parentNode.parentNode.removeChild(oElm.parentNode);
           content = content.replace('%a', unescape('%0A'));
-          parent.firstChild.nextSibling.nextSibling.nextSibling.innerHTML = content; // $content is set in ajax.responseText
+          var obj = ( IE ) ? parent.firstChild.nextSibling.nextSibling : parent.firstChild.nextSibling.nextSibling.nextSibling;
+          if ( obj )
+            obj.innerHTML = content; // $content is set in ajax.responseText
         }
         else
         {