atLoad method now called internally by each widget, no need to call externally. Tweak...
[infodrom/rico3] / minsrc / rico.js
index 73ecc75..5116aca 100644 (file)
@@ -366,10 +366,14 @@ Rico.positionCtlOverIcon=function(ctl,icon) {
   var scrTop=this.docScrollTop();
   var winHt=this.windowHeight();
   if (ctl.style.display=='none') ctl.style.display='block';
-  //var correction=this.isIE ? 1 : 2;  // based on a 1px border
   var correction=2;  // based on a 1px border
-  var lpad=this.nan2zero(this.getStyle(icon,'paddingLeft'));
-  ctl.style.left = (offsets.left+lpad+correction)+'px';
+  if (Rico.direction(icon) == 'rtl') {
+    //var margin=this.nan2zero(this.getStyle(icon,'marginRight'));
+    ctl.style.left = (offsets.left + icon.offsetWidth - ctl.offsetWidth)+'px';
+  } else {
+    var margin=this.nan2zero(this.getStyle(icon,'marginLeft'));
+    ctl.style.left = (offsets.left+margin+correction)+'px';
+  }
   var newTop=offsets.top + correction;// + scrTop;
   var ctlht=ctl.offsetHeight;
   var iconht=icon.offsetHeight;