aboutsummaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorArtur <artur@vaadin.com>2017-03-06 13:20:35 +0200
committerPekka Hyvönen <pekka@vaadin.com>2017-03-06 13:20:35 +0200
commit42064ade8f01440432792b27ecd16a98f29fb74d (patch)
tree6f6616e856fb8c1d693d45102d8fcdc828f39c32 /client
parent2eea115f410b19ae9b387151240921feac7c0db7 (diff)
downloadvaadin-framework-42064ade8f01440432792b27ecd16a98f29fb74d.tar.gz
vaadin-framework-42064ade8f01440432792b27ecd16a98f29fb74d.zip
Fix exception when no columns are shown (#8733)
* Fix exception when no columns are shown or all columns are frozen Fixes #8329
Diffstat (limited to 'client')
-rw-r--r--client/src/main/java/com/vaadin/client/widgets/Escalator.java26
1 files changed, 17 insertions, 9 deletions
diff --git a/client/src/main/java/com/vaadin/client/widgets/Escalator.java b/client/src/main/java/com/vaadin/client/widgets/Escalator.java
index 239ed9b90b..7eb99badf7 100644
--- a/client/src/main/java/com/vaadin/client/widgets/Escalator.java
+++ b/client/src/main/java/com/vaadin/client/widgets/Escalator.java
@@ -701,13 +701,13 @@ public class Escalator extends Widget
/*-{
var vScroll = esc.@com.vaadin.client.widgets.Escalator::verticalScrollbar;
var vScrollElem = vScroll.@com.vaadin.client.widget.escalator.ScrollbarBundle::getElement()();
-
+
var hScroll = esc.@com.vaadin.client.widgets.Escalator::horizontalScrollbar;
var hScrollElem = hScroll.@com.vaadin.client.widget.escalator.ScrollbarBundle::getElement()();
-
+
return $entry(function(e) {
var target = e.target;
-
+
// in case the scroll event was native (i.e. scrollbars were dragged, or
// the scrollTop/Left was manually modified), the bundles have old cache
// values. We need to make sure that the caches are kept up to date.
@@ -728,29 +728,29 @@ public class Escalator extends Widget
return $entry(function(e) {
var deltaX = e.deltaX ? e.deltaX : -0.5*e.wheelDeltaX;
var deltaY = e.deltaY ? e.deltaY : -0.5*e.wheelDeltaY;
-
+
// Delta mode 0 is in pixels; we don't need to do anything...
-
+
// A delta mode of 1 means we're scrolling by lines instead of pixels
// We need to scale the number of lines by the default line height
if(e.deltaMode === 1) {
var brc = esc.@com.vaadin.client.widgets.Escalator::body;
deltaY *= brc.@com.vaadin.client.widgets.Escalator.AbstractRowContainer::getDefaultRowHeight()();
}
-
+
// Other delta modes aren't supported
if((e.deltaMode !== undefined) && (e.deltaMode >= 2 || e.deltaMode < 0)) {
var msg = "Unsupported wheel delta mode \"" + e.deltaMode + "\"";
-
+
// Print warning message
esc.@com.vaadin.client.widgets.Escalator::logWarning(*)(msg);
}
-
+
// IE8 has only delta y
if (isNaN(deltaY)) {
deltaY = -0.5*e.wheelDelta;
}
-
+
@com.vaadin.client.widgets.Escalator.JsniUtil::moveScrollFromEvent(*)(esc, deltaX, deltaY, e);
});
}-*/;
@@ -4097,6 +4097,10 @@ public class Escalator extends Widget
*/
@Override
public void removeColumns(final int index, final int numberOfColumns) {
+ if (numberOfColumns == 0) {
+ return;
+ }
+
// Validate
assertArgumentsAreValidAndWithinRange(index, numberOfColumns);
@@ -4225,6 +4229,10 @@ public class Escalator extends Widget
*/
@Override
public void insertColumns(final int index, final int numberOfColumns) {
+ if (numberOfColumns == 0) {
+ return;
+ }
+
// Validate
if (index < 0 || index > getColumnCount()) {
throw new IndexOutOfBoundsException("The given index(" + index
class="na">name="all" depends="init, compile, test:compile"/> <target name="jar" depends="compile"> <delete file="${build.ajdir}/jars/runtime.jar"/> <copy file="runtime.mf.txt" todir="${build.ajdir}/temp" filtering="yes"/> <jar destfile="${build.ajdir}/jars/runtime.jar" manifest="${build.ajdir}/temp/runtime.mf.txt"> <fileset dir="bin"> <include name="**/*"/> </fileset> </jar> </target> </project>