Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Furnadjiev2016-04-20 10:52:16 -0400
committerIvan Furnadjiev2016-04-20 11:20:00 -0400
commit6f0cdd916f1cd8401cbf192d13d773d6cdc3cbd5 (patch)
treee63405bcbdfd296def643da3ec1c01647a8f1d35 /bundles
parent46b188e3a185e46f391a228138d596f8a2194e28 (diff)
downloadorg.eclipse.rap-6f0cdd916f1cd8401cbf192d13d773d6cdc3cbd5.tar.gz
org.eclipse.rap-6f0cdd916f1cd8401cbf192d13d773d6cdc3cbd5.tar.xz
org.eclipse.rap-6f0cdd916f1cd8401cbf192d13d773d6cdc3cbd5.zip
Fix dropdown position when website-like scrolling is enabled
DropDown.js#renderPosition doesn't respect scroll offset. Thus, dropdown position is wrong when there is no enough space. Use viewport height and scroll offset instead of document height in DropDown.js#renderPosition. Change-Id: I0ce038d0b767a027a5b78ea31994508af4f9668b
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.rap.rwt/js/rwt/widgets/DropDown.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/bundles/org.eclipse.rap.rwt/js/rwt/widgets/DropDown.js b/bundles/org.eclipse.rap.rwt/js/rwt/widgets/DropDown.js
index 2fea28ebc6..397e78d0c3 100644
--- a/bundles/org.eclipse.rap.rwt/js/rwt/widgets/DropDown.js
+++ b/bundles/org.eclipse.rap.rwt/js/rwt/widgets/DropDown.js
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2013, 2015 EclipseSource and others.
+ * Copyright (c) 2013, 2016 EclipseSource and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -373,8 +373,9 @@
function renderPosition() {
this._.popup.positionRelativeTo( this._.parent, 0, this._.parent.getHeight() );
- var docHeight = rwt.widgets.base.ClientDocument.getInstance().getInnerHeight();
- if( this._.popup.getTop() + this._.popup.getHeight() > docHeight ) {
+ var viewportHeight = rwt.html.Viewport.getHeight();
+ var scrollTop = rwt.html.Viewport.getScrollTop();
+ if( this._.popup.getTop() + this._.popup.getHeight() > viewportHeight + scrollTop ) {
this._.popup.positionRelativeTo( this._.parent, 0, -1 * this._.popup.getHeight() );
}
}

Back to the top