From: Joey Schulze Date: Mon, 21 Sep 2015 10:17:38 +0000 (+0200) Subject: Add horizontal scroll to control position X-Git-Url: https://git.infodrom.org/?p=infodrom%2Frico3;a=commitdiff_plain;h=20394624db6422b71e12f1cc5b19827bd458da96 Add horizontal scroll to control position Thus honor horizontal scroll and display control in visible area --- diff --git a/minsrc/rico.js b/minsrc/rico.js index a2467ba..55287bf 100644 --- a/minsrc/rico.js +++ b/minsrc/rico.js @@ -328,6 +328,7 @@ Rico.positionCtlOverIcon=function(ctl,icon) { icon=this.$(icon); var offsets=this.cumulativeOffset(icon); var scrTop=this.docScrollTop(); + var scrLeft=this.docScrollLeft(); var winHt=this.windowHeight(); if (ctl.style.display=='none') ctl.style.display='block'; var correction=2; // based on a 1px border @@ -336,7 +337,7 @@ Rico.positionCtlOverIcon=function(ctl,icon) { 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'; + ctl.style.left = (offsets.left+margin+correction+scrLeft)+'px'; } var newTop=offsets.top + correction;// + scrTop; var ctlht=ctl.offsetHeight;