New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with dynamically created/destroyed popup and fixed page header #6987

Closed
soulianis opened this Issue Jan 23, 2014 · 4 comments

Comments

Projects
None yet
7 participants
@soulianis

soulianis commented Jan 23, 2014

Problem description:

A page has a fixed page header (data-position='fixed').

A popup is dynamically created and destroyed/removed again on the popupafterclose event.

When destroying and removing the popup, the parent page loses its ui-page-header-fixed class and padding-top style, so that the top of the page content becomes covered by the page header.

As a workaround, the page classes and style are saved before the popup is created and restored later after the popup was destroyed and removed.

Test page:
http://jsbin.com/IFolanOW/111

The test page includes usage instructions to demonstrate the problem and the workaround.

@DickvdBrink

This comment has been minimized.

Show comment
Hide comment
@DickvdBrink

DickvdBrink Jan 23, 2014

Contributor

I think this is the same as the issue I have, see #6939

Contributor

DickvdBrink commented Jan 23, 2014

I think this is the same as the issue I have, see #6939

@cgack

This comment has been minimized.

Show comment
Hide comment
@cgack

cgack Mar 15, 2014

Contributor

It appears that this is happening because the _destroy method of the fixedToolbar widget finds the nearest page and removes the -fixed class:

https://github.com/jquery/jquery-mobile/blob/master/js/widgets/fixedToolbar.js#L285

@arschmitz I'm sure there is a good reason this is in here, but can you think of a change that could be made that would prevent this from happening? Perhaps something like checking if any -fixed children exist on the page or something to bypass this logic?

Contributor

cgack commented Mar 15, 2014

It appears that this is happening because the _destroy method of the fixedToolbar widget finds the nearest page and removes the -fixed class:

https://github.com/jquery/jquery-mobile/blob/master/js/widgets/fixedToolbar.js#L285

@arschmitz I'm sure there is a good reason this is in here, but can you think of a change that could be made that would prevent this from happening? Perhaps something like checking if any -fixed children exist on the page or something to bypass this logic?

@arschmitz

This comment has been minimized.

Show comment
Hide comment
@arschmitz

arschmitz Mar 15, 2014

Member

Yeah there is a similar situation in panels we check to see if any other panels are present a similar fix is needed here

Member

arschmitz commented Mar 15, 2014

Yeah there is a similar situation in panels we check to see if any other panels are present a similar fix is needed here

cgack added a commit to cgack/jquery-mobile that referenced this issue Mar 17, 2014

@gabrielschulhof gabrielschulhof added this to the 1.4.3 milestone Mar 20, 2014

cgack added a commit to cgack/jquery-mobile that referenced this issue May 29, 2014

cgack added a commit to cgack/jquery-mobile that referenced this issue Jun 2, 2014

cgack added a commit to cgack/jquery-mobile that referenced this issue Jun 6, 2014

Toolbar: removing popup removes page-header-fixed class
Adds _destroy to toolbar.js and _super() for fixedToolbar

Fixes gh-6987
Fixes gh-6939

@jaspermdegroot jaspermdegroot modified the milestones: 1.4.4, 1.4.3 Jun 18, 2014

cgack added a commit to cgack/jquery-mobile that referenced this issue Jul 31, 2014

cgack added a commit to cgack/jquery-mobile that referenced this issue Jul 31, 2014

Toolbar: removing popup removes page-header-fixed class
Some cleanup from pr review and added more destroy tests

Fixes gh-6987
Fixes gh-6939
@lobbin

This comment has been minimized.

Show comment
Hide comment
@lobbin

lobbin Aug 20, 2014

Contributor

Will this also fix the problem I'm seeing with padding-top being removed from the page when closing a popup?

http://jsfiddle.net/nu503x7s/2/

Contributor

lobbin commented Aug 20, 2014

Will this also fix the problem I'm seeing with padding-top being removed from the page when closing a popup?

http://jsfiddle.net/nu503x7s/2/

cgack added a commit to cgack/jquery-mobile that referenced this issue Aug 28, 2014

cgack added a commit to cgack/jquery-mobile that referenced this issue Aug 29, 2014

cgack added a commit to cgack/jquery-mobile that referenced this issue Sep 4, 2014

cgack added a commit to cgack/jquery-mobile that referenced this issue Sep 4, 2014

cgack added a commit to cgack/jquery-mobile that referenced this issue Sep 4, 2014

@arschmitz arschmitz closed this in 3efe6fe Sep 4, 2014

arschmitz added a commit that referenced this issue Sep 12, 2014

agcolom added a commit to agcolom/jquery-mobile that referenced this issue Nov 26, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment