Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

resize and orientationchange events #19

Open
serhiisol opened this issue Feb 27, 2015 · 0 comments
Open

resize and orientationchange events #19

serhiisol opened this issue Feb 27, 2015 · 0 comments

Comments

@serhiisol
Copy link

Hi.

I've found, that scroller subscribes on resize and orientationchange events and executes resize method inside.

Android with adjustResize windowSoftInputMode triggers event resize, but sometimes its important not to resize scroller on previous page.

Just for instance, I have my own navigation system, which detaches previous view from the dom, but still keeps dom node inside and still executes and listens to some events (resize as well).

According to that my view node has 100% width and height of parents node, resize method will calculate incorrect scroller size and position or something else.

I can't prevent execution of resize method except commenting it inside library, but it is not a good practice.

If I'll comment it, everything works fine.

For real resize event, we can add additional listener manually, just for instance with jquery:

$(window).on('resize', function () {
    scroller.resize();
});
$(window).on('orientationchange', function () {
    scroller.resize();
});

Please, add feature for disabling resize after resize and orientationchange events, like option:

var scroller = new Scroller(el, {
    listenResize: false
});

Or don't listen to resize or orientationchange events.

Thanks.

PS: I can create PR, if you'll agree with it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant