Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Furnadjiev2016-06-24 07:59:26 -0400
committerIvan Furnadjiev2016-07-04 06:11:47 -0400
commit2dc517df44e3aa4169da4d8ee6e2a3b62d3dd9c9 (patch)
treeacb0155d7178cbd7f8cfd258fdad3bbbe3b437d2 /bundles
parent60b2bcae074db268dd98aa5a45e46ac92d9bfcc0 (diff)
downloadorg.eclipse.rap-2dc517df44e3aa4169da4d8ee6e2a3b62d3dd9c9.tar.gz
org.eclipse.rap-2dc517df44e3aa4169da4d8ee6e2a3b62d3dd9c9.tar.xz
org.eclipse.rap-2dc517df44e3aa4169da4d8ee6e2a3b62d3dd9c9.zip
Fix Grid vertical scrollbar is shown unnecessarily
The implementation of Grid.js#_getLastPageRowCount does not use last visible item, but last root item. As a result the vertical scrollbar is shown unnecessarily in some cases. 496261: VerticalScrollBar truncates content when using GridTreeViewer https://bugs.eclipse.org/bugs/show_bug.cgi?id=496261 Change-Id: I89607f37c0abd27139011decd32ee71ebb33fd3c
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.rap.rwt/js/rwt/widgets/Grid.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/bundles/org.eclipse.rap.rwt/js/rwt/widgets/Grid.js b/bundles/org.eclipse.rap.rwt/js/rwt/widgets/Grid.js
index e4eb02d688..49d7a8844c 100644
--- a/bundles/org.eclipse.rap.rwt/js/rwt/widgets/Grid.js
+++ b/bundles/org.eclipse.rap.rwt/js/rwt/widgets/Grid.js
@@ -975,7 +975,7 @@ rwt.qx.Class.define( "rwt.widgets.Grid", {
_getLastPageRowCount : function() {
var availableHeight = this._getClientAreaHeight();
- var item = this.getRootItem().getLastChild();
+ var item = this._getLastVisibleItem();
var result = 0;
while( item && availableHeight > 0 ) {
availableHeight -= item.getOwnHeight();
@@ -987,6 +987,14 @@ rwt.qx.Class.define( "rwt.widgets.Grid", {
return result;
},
+ _getLastVisibleItem : function() {
+ var item = this.getRootItem().getLastChild();
+ while( item && item.hasChildren() && item.isExpanded() ) {
+ item = item.getLastChild();
+ }
+ return item;
+ },
+
_updateScrollThumbHeight : function() {
if( !this._altScrollingEnabled ) {
var value = Math.max( 1, Math.floor( this._getClientAreaHeight() / this._itemHeight ) );

Back to the top