]> source.dussan.org Git - vaadin-framework.git/commitdiff
Makes IE8 use the correct property in scroll event object
authorHenrik Paul <henrik@vaadin.com>
Thu, 16 Jan 2014 08:49:59 +0000 (10:49 +0200)
committerLeif Åstrand <leif@vaadin.com>
Thu, 16 Jan 2014 08:56:48 +0000 (08:56 +0000)
Change-Id: Ida17ddc9675ab276f29d5fed9cef9cec567e0eae

client/src/com/vaadin/client/ui/grid/Escalator.java
client/src/com/vaadin/client/ui/grid/ScrollbarBundle.java

index 887db8a758ccd5dd7f08d0a1ca5057081543a6ca..3ef8dcda316bb1f8156a3dd489107f2086304b53 100644 (file)
@@ -567,15 +567,17 @@ public class Escalator extends Widget {
             var hScrollElem = hScroll.@com.vaadin.client.ui.grid.ScrollbarBundle::getElement()();
 
             return $entry(function(e) {
+                var target = e.target || e.srcElement; // IE8 uses e.scrElement
+            
                 // 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.
-                if (e.target === vScrollElem) {
+                if (target === vScrollElem) {
                     vScroll.@com.vaadin.client.ui.grid.ScrollbarBundle::updateScrollPosFromDom()();
-                } else if (e.target === hScrollElem) {
+                } else if (target === hScrollElem) {
                     hScroll.@com.vaadin.client.ui.grid.ScrollbarBundle::updateScrollPosFromDom()();
                 } else {
-                    $wnd.console.error("unexpected scroll target: "+e.target);
+                    $wnd.console.error("unexpected scroll target: "+target);
                 }
 
                 esc.@com.vaadin.client.ui.grid.Escalator::onScroll()();
index 922daefa5f7672e3731a211f2d13cd241489853e..dc26d91fa2883b55376941690a29cf44f7cdf8d7 100644 (file)
@@ -277,7 +277,10 @@ abstract class ScrollbarBundle {
      * @return the new scroll position in pixels
      */
     public final int getScrollPos() {
-        assert internalGetScrollPos() == scrollPos : "calculated scroll position did not match the actual scroll position";
+        assert internalGetScrollPos() == scrollPos : "calculated scroll position ("
+                + scrollPos
+                + ") did not match the DOM element scroll position ("
+                + internalGetScrollPos() + ")";
         return scrollPos;
     }