]> source.dussan.org Git - vaadin-framework.git/commitdiff
[merge from 6.7] Fix #8810 - only animate row expansion if there are child rows to...
authorAutomerge <automerge@vaadin.com>
Fri, 18 May 2012 08:45:02 +0000 (08:45 +0000)
committerAutomerge <automerge@vaadin.com>
Fri, 18 May 2012 08:45:02 +0000 (08:45 +0000)
svn changeset:23763/svn branch:6.8

src/com/vaadin/terminal/gwt/client/ui/VTreeTable.java
tests/testbench/com/vaadin/tests/components/treetable/RowAnimation.html [new file with mode: 0644]

index 8e55400f317b0e7bbaf1a9f21cd0ca7dfb4ad5f6..13a60c74b9739373006695aed11830e38b10bd72 100644 (file)
@@ -496,8 +496,11 @@ public class VTreeTable extends VScrollTable {
                 int firstIndex, int rows) {
             List<VScrollTableRow> 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<VScrollTableRow> 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 (file)
index 0000000..64ff061
--- /dev/null
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="" />
+<title>TestAnimatedExpandCollapse</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">TestAnimatedExpandCollapse</td></tr>
+</thead><tbody>
+<tr>
+       <td>open</td>
+       <td>/run/com.vaadin.tests.components.treetable.TreeTableTest?restartApplication</td>
+       <td></td>
+</tr>
+<tr>
+       <td>mouseClick</td>
+       <td>vaadin=runcomvaadintestscomponentstreetableTreeTableTest::PID_Smenu#item0</td>
+       <td>38,10</td>
+</tr>
+<tr>
+       <td>mouseClick</td>
+       <td>vaadin=runcomvaadintestscomponentstreetableTreeTableTest::Root/VOverlay[0]/VMenuBar[0]#item0</td>
+       <td>35,5</td>
+</tr>
+<tr>
+       <td>mouseClick</td>
+       <td>vaadin=runcomvaadintestscomponentstreetableTreeTableTest::Root/VOverlay[1]/VMenuBar[0]#item7</td>
+       <td>30,12</td>
+</tr>
+<tr>
+       <td>mouseClick</td>
+       <td>vaadin=runcomvaadintestscomponentstreetableTreeTableTest::PID_StestComponent/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
+       <td>12,7</td>
+</tr>
+<tr>
+       <td>mouseClick</td>
+       <td>vaadin=runcomvaadintestscomponentstreetableTreeTableTest::PID_StestComponent/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]</td>
+       <td>31,7</td>
+</tr>
+<tr>
+       <td>mouseClick</td>
+       <td>vaadin=runcomvaadintestscomponentstreetableTreeTableTest::PID_StestComponent/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]/domChild[0]</td>
+       <td>29,8</td>
+</tr>
+<tr>
+       <td>mouseClick</td>
+       <td>vaadin=runcomvaadintestscomponentstreetableTreeTableTest::PID_StestComponent/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[3]/domChild[0]/domChild[0]/domChild[0]</td>
+       <td>30,6</td>
+</tr>
+<tr>
+       <td>assertText</td>
+       <td>vaadin=runcomvaadintestscomponentstreetableTreeTableTest::PID_StestComponent/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+       <td>Item 4,1</td>
+</tr>
+<tr>
+       <td>assertText</td>
+       <td>vaadin=runcomvaadintestscomponentstreetableTreeTableTest::PID_StestComponent/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
+       <td>Item 5,1</td>
+</tr>
+<tr>
+       <td>assertText</td>
+       <td>vaadin=runcomvaadintestscomponentstreetableTreeTableTest::PID_StestComponent/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[3]/domChild[0]/domChild[0]</td>
+       <td>Item 6,1</td>
+</tr>
+<tr>
+       <td>assertText</td>
+       <td>vaadin=runcomvaadintestscomponentstreetableTreeTableTest::PID_StestComponent/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[4]/domChild[0]/domChild[0]</td>
+       <td>Item 7,1</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>