diff options
author | patrik <patrik@vaadin.com> | 2015-06-25 11:06:33 +0300 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2015-06-29 10:09:16 +0000 |
commit | f4069826fb36ecc62f9436b99b046201f562d2f9 (patch) | |
tree | 1f47af10083583f6bdf133ca2e1ca0ac506182e6 /client | |
parent | 77583865f85abb59a7162c53651b3ef426be5a7c (diff) | |
download | vaadin-framework-f4069826fb36ecc62f9436b99b046201f562d2f9.tar.gz vaadin-framework-f4069826fb36ecc62f9436b99b046201f562d2f9.zip |
Fix Grid scrolling on Firefox (#16865. #17352)
Change-Id: I58ac7c03be2a4d950ecfba609fddf862f2fd966f
Diffstat (limited to 'client')
-rw-r--r-- | client/src/com/vaadin/client/widgets/Escalator.java | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/client/src/com/vaadin/client/widgets/Escalator.java b/client/src/com/vaadin/client/widgets/Escalator.java index 3e08cc1f1f..1bb3fe3747 100644 --- a/client/src/com/vaadin/client/widgets/Escalator.java +++ b/client/src/com/vaadin/client/widgets/Escalator.java @@ -803,7 +803,24 @@ public class Escalator extends Widget implements RequiresResize, 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; @@ -6700,4 +6717,8 @@ public class Escalator extends Widget implements RequiresResize, private String getSubPartNameSpacer(Element subElement) { return body.spacerContainer.getSubPartName(subElement); } + + private void logWarning(String message) { + getLogger().warning(message); + } } |