Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Add an 'afterposition' event to popup #8053

Closed
jodator opened this issue Mar 31, 2015 · 4 comments
Closed

Add an 'afterposition' event to popup #8053

jodator opened this issue Mar 31, 2015 · 4 comments

Comments

@jodator
Copy link

jodator commented Mar 31, 2015

It would be nice if "popup" have an event triggered after doing positioning.

Right now I have to do setTimeout in beforeposition event do do some calculation after the dialog has changed position.

@gabrielschulhof
Copy link

@jodator you can solve this with an extension:

$.widget( "mobile.popup", $.mobile.popup, {
    _reposition: function() {

        // Do whatever popup does to reposition itself
        this._super();

        this._trigger( "afterposition" );
    }
} );

Also, if you need to perform this calculation for every popup in your application, you can just perform it right after this._super() and forego triggering afterposition altogether.

If this still does not address your concerns, please feel free to reopen the issue.

@jodator
Copy link
Author

jodator commented Mar 31, 2015

Thanks for that @gabrielschulhof. This probably will solve this, but I've added this request in case some else would want such event. Also I don't like to mess with external lib's "_private" methods in case something changes.

@gabrielschulhof
Copy link

@jodator OK, that's fair. I'll add this to our list of feature requests.

@gabrielschulhof
Copy link

OK, so it's already added :)

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

No branches or pull requests

2 participants