You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2010/08/02 11:38:40 UTC
svn commit: r981430 -
/myfaces/tobago/branches/tobago-1.0.x/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/inputSuggest.js
Author: lofwyr
Date: Mon Aug 2 09:38:39 2010
New Revision: 981430
URL: http://svn.apache.org/viewvc?rev=981430&view=rev
Log:
TOBAGO-903: Wrong calculation of suggest box position
Modified:
myfaces/tobago/branches/tobago-1.0.x/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/inputSuggest.js
Modified: myfaces/tobago/branches/tobago-1.0.x/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/inputSuggest.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.0.x/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/inputSuggest.js?rev=981430&r1=981429&r2=981430&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/inputSuggest.js (original)
+++ myfaces/tobago/branches/tobago-1.0.x/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/inputSuggest.js Mon Aug 2 09:38:39 2010
@@ -22,7 +22,7 @@ Object.extend(new Ajax.Base(), {
initialize: function(element, page, options) {
this.baseInitialize(element, $(element).id + Tobago.SUB_COMPONENT_SEP + "ajaxPopup", options);
this.options.asynchronous = true;
- this.options.onComplete = this.onComplete.bind(this)
+ this.options.onComplete = this.onComplete.bind(this);
this.options.method = 'post';
this.page = $(page);
this.options.onShow =
@@ -31,8 +31,9 @@ Object.extend(new Ajax.Base(), {
if(!update.style.position || update.style.position=='absolute') {
update.style.position = 'absolute';
var offsets = Position.cumulativeOffset(element);
- update.style.top = (offsets[1] + element.offsetHeight) + 'px';
- update.style.left = offsets[0] + 'px';
+ var scrollOffsets = Position.realOffset(element);
+ update.style.top = (offsets[1] - scrollOffsets[1] + document.body.scrollTop + element.offsetHeight) + 'px';
+ update.style.left = (offsets[0] - scrollOffsets[0] + document.body.scrollLeft) + 'px';
}
Effect.Appear(update,{duration:0.15});
};