From: Automerge Date: Fri, 18 May 2012 08:45:02 +0000 (+0000) Subject: [merge from 6.7] Fix #8810 - only animate row expansion if there are child rows to... X-Git-Tag: 7.0.0.alpha3~147^2~2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7f8bcc2638e5fe97e3a362e86a3b7953c0663e8e;p=vaadin-framework.git [merge from 6.7] Fix #8810 - only animate row expansion if there are child rows to animate svn changeset:23763/svn branch:6.8 --- diff --git a/src/com/vaadin/terminal/gwt/client/ui/VTreeTable.java b/src/com/vaadin/terminal/gwt/client/ui/VTreeTable.java index 8e55400f31..13a60c74b9 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VTreeTable.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VTreeTable.java @@ -496,8 +496,11 @@ public class VTreeTable extends VScrollTable { int firstIndex, int rows) { List insertedRows = insertAndReindexRows(rowData, firstIndex, rows); - RowExpandAnimation anim = new RowExpandAnimation(insertedRows); - anim.run(150); + if (!insertedRows.isEmpty()) { + // Only animate if there's something to animate (#8810) + RowExpandAnimation anim = new RowExpandAnimation(insertedRows); + anim.run(150); + } return insertedRows; } @@ -620,6 +623,10 @@ public class VTreeTable extends VScrollTable { private Element cloneTable; private AnimationPreparator preparator; + /** + * @param rows + * List of rows to animate. Must not be empty. + */ public RowExpandAnimation(List rows) { this.rows = rows; buildAndInsertAnimatingDiv(); diff --git a/tests/testbench/com/vaadin/tests/components/treetable/RowAnimation.html b/tests/testbench/com/vaadin/tests/components/treetable/RowAnimation.html new file mode 100644 index 0000000000..64ff061c13 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/treetable/RowAnimation.html @@ -0,0 +1,77 @@ + + + + + + +TestAnimatedExpandCollapse + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TestAnimatedExpandCollapse
open/run/com.vaadin.tests.components.treetable.TreeTableTest?restartApplication
mouseClickvaadin=runcomvaadintestscomponentstreetableTreeTableTest::PID_Smenu#item038,10
mouseClickvaadin=runcomvaadintestscomponentstreetableTreeTableTest::Root/VOverlay[0]/VMenuBar[0]#item035,5
mouseClickvaadin=runcomvaadintestscomponentstreetableTreeTableTest::Root/VOverlay[1]/VMenuBar[0]#item730,12
mouseClickvaadin=runcomvaadintestscomponentstreetableTreeTableTest::PID_StestComponent/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]12,7
mouseClickvaadin=runcomvaadintestscomponentstreetableTreeTableTest::PID_StestComponent/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]31,7
mouseClickvaadin=runcomvaadintestscomponentstreetableTreeTableTest::PID_StestComponent/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]/domChild[0]29,8
mouseClickvaadin=runcomvaadintestscomponentstreetableTreeTableTest::PID_StestComponent/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[3]/domChild[0]/domChild[0]/domChild[0]30,6
assertTextvaadin=runcomvaadintestscomponentstreetableTreeTableTest::PID_StestComponent/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]Item 4,1
assertTextvaadin=runcomvaadintestscomponentstreetableTreeTableTest::PID_StestComponent/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]Item 5,1
assertTextvaadin=runcomvaadintestscomponentstreetableTreeTableTest::PID_StestComponent/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[3]/domChild[0]/domChild[0]Item 6,1
assertTextvaadin=runcomvaadintestscomponentstreetableTreeTableTest::PID_StestComponent/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[4]/domChild[0]/domChild[0]Item 7,1
+ +