Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Buschtöns2013-10-25 08:27:46 -0400
committerTim Buschtöns2013-10-25 08:41:13 -0400
commit415e47975cb1ad4ecfe899c9801f1fd06384c27c (patch)
tree29e0fc4e5ba8f91cccca937270a359b28411c3be
parentb4253fc033868a92945cc5af8d44441a841d8b3a (diff)
downloadorg.eclipse.rap.incubator.dropdown-streams/2.1.tar.gz
org.eclipse.rap.incubator.dropdown-streams/2.1.tar.xz
org.eclipse.rap.incubator.dropdown-streams/2.1.zip
Prevent crash if dropdown is updated while parent is not createdstreams/2.1
-rw-r--r--bundles/org.eclipse.rap.addons.dropdown/js/rwt/dropdown/DropDown.js6
-rw-r--r--tests/org.eclipse.rap.addons.dropdown.test/js/rwt/dropdown/DropDown_Test.js11
2 files changed, 14 insertions, 3 deletions
diff --git a/bundles/org.eclipse.rap.addons.dropdown/js/rwt/dropdown/DropDown.js b/bundles/org.eclipse.rap.addons.dropdown/js/rwt/dropdown/DropDown.js
index 30b1627..8b44d43 100644
--- a/bundles/org.eclipse.rap.addons.dropdown/js/rwt/dropdown/DropDown.js
+++ b/bundles/org.eclipse.rap.addons.dropdown/js/rwt/dropdown/DropDown.js
@@ -94,7 +94,7 @@
this.setSelectionIndex( -1 );
this._.items = rwt.util.Arrays.copy( items );
renderGridItems.call( this );
- if( this._.visibility ) {
+ if( this._.grid.isSeeable() ) {
renderLayout.call( this );
}
updateScrollBars.call( this );
@@ -114,7 +114,7 @@
*/
setVisibleItemCount : function( itemCount ) {
this._.visibleItemCount = itemCount;
- if( this._.visibility ) {
+ if( this._.grid.isSeeable() ) {
renderLayout.call( this );
}
updateScrollBars.call( this );
@@ -232,7 +232,7 @@
setColumns : function( columns ) {
this._.columns = columns;
this._.grid.setColumnCount( columns.length );
- if( this._.visibility ) {
+ if( this._.grid.isSeeable() ) {
renderLayout.call( this );
}
},
diff --git a/tests/org.eclipse.rap.addons.dropdown.test/js/rwt/dropdown/DropDown_Test.js b/tests/org.eclipse.rap.addons.dropdown.test/js/rwt/dropdown/DropDown_Test.js
index 3136d39..e813f7d 100644
--- a/tests/org.eclipse.rap.addons.dropdown.test/js/rwt/dropdown/DropDown_Test.js
+++ b/tests/org.eclipse.rap.addons.dropdown.test/js/rwt/dropdown/DropDown_Test.js
@@ -554,6 +554,17 @@ rwt.qx.Class.define( "rwt.dropdown.DropDown_Test", {
assertEquals( 400, popup.getInnerWidth() );
},
+ testSetColumns_setsPopUpWidthAfterParentAppear : function() {
+ widget.destroy();
+ dropdown.destroy();
+ this.createExample();
+ dropdown.show();
+ dropdown.setColumns( [ 100, 200, 100 ] );
+ TestUtil.flush();
+
+ assertEquals( 400, popup.getInnerWidth() );
+ },
+
testSetColumns_setsDoesNotSetPopUpWidthIfSmaller : function() {
dropdown.setColumns( [ 30 ] );
showDropDown();

Back to the top