dinbror / bpopup

bPopup is a lightweight jQuery modal popup plugin (only 1.34KB gzipped). It doesn't create or style your popup but provides you with all the logic like centering, modal overlay, events and more. It gives you a lot of opportunities to customize so it will fit your needs.
http://dinbror.dk/bPopup
427 stars 260 forks source link

Added public reposition method and escCloseAll option #8

Closed MGotink closed 9 years ago

MGotink commented 11 years ago

I've added a public reposition method to allow manual repositioning of the popup after the contents have been changed. I've also added the escCloseAll option to control if all open or only the topmost popup should be closed, default true.

Regards, Martin

byo commented 11 years ago

I really like the reposition option :+1:

mscalora commented 10 years ago

I like the reposition option too

dinbror commented 10 years ago

Added in v. 0.10.0 (https://github.com/dinbror/bpopup#v-0100-07-22-2014)

pavdro commented 10 years ago

Just wanted to give a heads up on the reposition function. Don't know if anyone tested it, but there's a clear bug in it. When repositioning IF statement only checks for fixedPosStyle and not fixedVPos and fixedHPos, so in my case "position: ['auto', 0]", it doesn't reposition it properly in the center.

Think there are also some hardcoded values in there as well.

Update Also why is there "if (inside) " check no idea???

dinbror commented 10 years ago

Hey pavdro.

You're right. Didn't test against that use case. Will have a fix in the next release. The "if(inside)" is mostly for when you resize the window. If the popup is too big and doesn't fit the window it won't move the popup to ensure that you always can see everything inside the popup.

pavdro commented 10 years ago

Nice 1! yeah I got resizing case, but it still kinda screws up stuff. maybe move the check into option so make it optional?

pavdro commented 10 years ago

Actually. I know what you mean, I think to fix my issue separating inside to X and Y will fix it. Since I still want it to align to center even if vertically it should stay on the same spot.

dinbror commented 9 years ago

fixed in v. 0.11.0