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

Already on GitHub? Sign in to your account

option to disable automatic resetActivePageHeight #5530

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
3 participants

As I'm increasingly using jQM for "mobile-first, but not mobile only," I'm finding it useful to add a healthy margin around the page for larger screen sizes. This could be done using only CSS breakpoints were it not for the automated resetActivePageHeight. This patch allows resetActivePageHeight to function differently above a configurable screen width (like $.mobile.maxTransitionWidth). Above the specified maxAutoHeightAdjustmentWidth, resetActivePageHeight will clear out the min-height, allowing it to be configured via CSS for larger screen sizes.

Member

jaspermdegroot commented Jan 26, 2013

@sheppard

Thanks for the PR!

If we would make this optional and it is set to false, a lot of the unstyled body will be visible below the page if there is not much content on the page. Besides this, I think there might be issues with page transitions.

The resetActivePageHeight function already takes border and padding into account (while those default to 0). Don't you think it would be a better approach if we would do the same for margin?

Thanks for looking at this. My idea is that defaulting this option to false would preserve the current behavior (similar to how setting maxTransitionWidth=false means transitions are always on). As far as the other issues my implicit assumptions included:

  • the developer would know that setting this option would expose the body, and modify their CSS accordingly, e.g. by adding a custom background gradient to the body for large screens and a min-height to the page div.
  • while there probably will be issues with page transitions (at least aesthetically if not technically), the developer would probably want to turn off transitions above the specified width anyway.

I hadn't thought about whether the existing function could be modified to take the margin into account in the computation. My current approach has been to use min-height but I'll see if I can get the effect I want with a margin and get back to you.

Member

gseguin commented Mar 20, 2013

@sheppard, Thank you for the pull request! It seems like you haven't signed a CLA. Please visit http://contribute.jquery.org/CLA/ and sign it so we can look into your PR.

Thank you.

@ghost ghost assigned jaspermdegroot Mar 27, 2013

Member

jaspermdegroot commented Apr 3, 2013

@sheppard

As discussed on IRC the other week you can override the inline style if needed. I just committed 509f3b4 which makes resetActivePageHeight() take margin into account as well.
Closing this PR. Thanks again for your effort!

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