randolph249 / iscroll-js

Automatically exported from code.google.com/p/iscroll-js
MIT License
0 stars 0 forks source link

iScroll doesn't work in htmlunit #46

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. create a web application the uses iScroll
2. write acceptance tests for application that use htmlunit
3. htmlunit doesn't support addEventListner with an object so it throughs an 
exception

Expected output is passing tests
We see an exception.

Version 3.7.1 - Last updated: 2010.10.08.

Here is the fix from around line 60

    var eventHandler = function(e) {
       that.handleEvent(e);
    };

    window.addEventListener('onorientationchange' in window ? 'orientationchange' : 'resize', eventHandler, false);

    if (isTouch || that.options.desktopCompatibility) {
        that.element.addEventListener(START_EVENT, eventHandler, false);
        that.element.addEventListener(MOVE_EVENT, eventHandler, false);
        that.element.addEventListener(END_EVENT, eventHandler, false);
    }

    if (that.options.checkDOMChanges) {
        that.element.addEventListener('DOMSubtreeModified', eventHandler, false);
    }

Original issue reported on code.google.com by matthew....@gmail.com on 9 Feb 2011 at 3:43