Skip to content

panelHeight() calcualte the contents 'margin-top' bug #46

Open

Description

@keepallsimple

i use the JQM 1.2.0-rc2, and foud an issue in panelheight() function when calcualte the conents margin-top and margin-bottom:

in multiview.js line 1238:

                    ct.css({    "max-height": setH, 
                                "margin-top": blacklist == true ? glbH + lclH : 0, 
                                "margin-bottom": blacklist == true ? glbF + lclF  : 0
                            })
                    }

when the blacklist is false, the margin-top and margin-bottom value is set to 0, infact ,it should be lclH and lclF.

is right?

Activity

  1. frequent commented on Oct 2, 2012

    @frequent
    Owner

    panelHeight and panelWidth are both bummers.... hard to get right and slowing things down considerably. Adding to the confusing is the default padding Jquery Mobile is setting on pages, which most of the times ends up on wrapper and nested pages alike. Anyway...

    Let me check. Probably you are correct.

  2. sstraus commented on Oct 7, 2012

    @sstraus

    I have the same problem with JQM 1.2.0. Looks like JQM doesn't adds 43px padding anymore. Do you think that is safe to remove the blacklist check from ct.css?

  3. frequent commented on Oct 7, 2012

    @frequent
    Owner

    I found out what's causing it. Whenever you have a fixed header/footer, JQM is adding a class of ui-page-header|footer-fixed to the page, which then sets the padding.

    I fixed this for non-overthrow mode yesterday (not commited yet):

    Try adding this to your CSS:

     /* override fixed footer and header padding on nested page */
    .ui-panel .ui-page-header-fixed                     { padding-top: 0 !important; }
    .ui-panel .ui-page-footer-fixed                     { padding-bottom: 0 !important;}
    

    and see if it works.

  4. frequent commented on Oct 7, 2012

    @frequent
    Owner

    I will try to update to JQM 1.2.0 sometimes end of next week. I need to have the current multiview version working while I'm testing on another project.

  5. sstraus commented on Oct 7, 2012

    @sstraus

    No, it doesn't fix. I'm tring variants but nothing works as expected.

  6. frequent commented on Oct 7, 2012

    @frequent
    Owner

    This is such a pain in the a... If I'm spending time on mv, I'm always sitting over content height & width functions...

  7. sstraus commented on Oct 14, 2012

    @sstraus

    Please take a look at this issue. Is really frustrating.
    Thanks.

  8. sstraus commented on Oct 20, 2012

    @sstraus

    there is some hope for overthrow ? I know that you're very busy, but I'm in troble with the iPad.

  9. frequent commented on Oct 26, 2012

    @frequent
    Owner

    ok. I'm on it. Let's see what I can do.

  10. frequent commented on Oct 26, 2012

    @frequent
    Owner

    @sstraus , @keepallsimple

    Ok.Please try and add this to your CSS file:

    .ui-overthrow-mode div[data-wrapper="true"] { 
        padding-top: 0px !important; 
        padding-bottom: 0px !important;
        }
    

    This overwrites padding top/bottom on the wrapper page, too, which caused this page to be too "long" and false scrollbars to appear.

    Does this take care of your problem?

    The blacklist and margin I need because otherwise the content will "fall" behind the toolbars. This is because blacklist = does not support fixed toolbars. For these devices, JQM changes to position:absolute, which takes the element out of the page flow and causes the following elements (content) to start from the top of the page. If position:fixed is supported, the header/footer stay in the page flow, so you don't need margin to push them out from underneath the toolbars. I hope this is correct and you understand what I mean.

    Sorry for taking so long... please let me know if this fixes your problem. If not I will have another look.

    Cheers

  11. sstraus commented on Oct 28, 2012

    @sstraus

    I'm sorry but doesn't work. CSS are applied correctly to the div but the content is still shifted up.

  12. sstraus commented on Oct 28, 2012

    @sstraus

    BTW, my problem is not related to scrollbars, panels are hidden by the topbar. Adding a top margin of 43px to the page container, is a workaround to fix the problem. But I can't undertand why you don't have this issue. On my app is present also in chrome.

  13. frequent commented on Oct 28, 2012

    @frequent
    Owner

    ok. I managed to reproduce now. I never understood what the problem really was. I think I have it fixed. Will commit today.

  14. sstraus commented on Oct 30, 2012

    @sstraus

    Can you share a hint on how to fix it?

  15. frequent commented on Oct 30, 2012

    @frequent
    Owner

    first hint:
    Problem for me was that I had a fixed footer on the nested page (a page in main/menu). Since it was fixed footer, JQM moved it to pos:abs/fixed bottom of the screen but it's margin was still on the nested page.

    I removed the footer, which also cleared the margin. It should also work if you don't set footers on nested pages to pos:fixed.


    From: sstraus notifications@github.com
    To: frequent/multiview multiview@noreply.github.com
    Cc: Sven Franck svenfranck@yahoo.com
    Sent: Tuesday, October 30, 2012 8:07 AM
    Subject: Re: [multiview] panelHeight() calcualte the contents 'margin-top' bug (#46)

    Can you share a hint on how to fix it?
    —
    Reply to this email directly or view it on GitHub.

  16. sstraus commented on Oct 30, 2012

    @sstraus

    Thank you, but this is not my case because I have just one fixed footer on the main page. Other options?

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions