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

Port custom select menus over to use popup #4329

Closed
toddparker opened this issue May 10, 2012 · 9 comments
Closed

Port custom select menus over to use popup #4329

toddparker opened this issue May 10, 2012 · 9 comments

Comments

@toddparker
Copy link
Contributor

Once popup is working well, we should re-wrok custom selects to use popup and add this as a dependency.

@ghost ghost assigned gabrielschulhof May 10, 2012
@gabrielschulhof
Copy link

We need to figure out what happens when a popup contains a custom select menu - the situation pretty much precludes using mutually exclusive popups, favouring a popup stack instead.

@toddparker
Copy link
Contributor Author

That is a good point. If this adds a ton of code complexity, we could consider forcing all selects in popups to use the native menu. It's a constraint that may be acceptable (is to me).

@gabrielschulhof
Copy link

Let's find out if this adds a ton of code complexity. I am beginning to develop the distinct impression that a stack is easier to manage than mutual exclusivity.

@toddparker
Copy link
Contributor Author

@gabrielschulhof - I think you had some info on this on IRC. Mind posting some notes on that here?

@gabrielschulhof
Copy link

The stuff I talked about on IRC was mostly for @johnbender ... It stems from the following:

It turns out that doing a stack has almost exactly the same code as doing mutually exclusive popups. The only additional thing one needs to do is to ensure that whichever popup is the last one to have been opened ends up on top of all the other already-open popups.

This means that we need to keep track of the z-index values of each screen that is open, and each popup container. This is pretty simple, since we're already storing the already-open popups in a list. We just keep the max value of each of the two (screen and container) z-index values around, and give each new popup the max plus one.

What I was telling @johnbender was that this popup manager can be extended to handle things other than popups as well - i.e., all in-page-navigation can be handled via one of these managers.

@gabrielschulhof
Copy link

Check out the new branch: https://github.com/jquery/jquery-mobile/tree/popup-widget-stack

@gabrielschulhof
Copy link

@ladar
Copy link

ladar commented May 17, 2012

The popup widget is awesome. I might use it with the project I'm working on.

What I was asking for with #4369 was an option for opening the popups as full screen dialogs. v1.1 does that with custom select menus already if they exceed a certain size. Check out the "Choose state(s)" select menu on http://jquerymobile.com/demos/1.1.0/docs/forms/selects/custom.html

@gabrielschulhof
Copy link

I have now moved select over to using popup.

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

3 participants