Creating a new issue as I know this is present, and want this broke out to its own issue for tracking and alternative solutions.

The issue is present in latest Chrome & Safari browsers in the Gamma subtheme.

The (original) code below from gamma.js faded in the menu after page load, and positioned it halfway vertically in the header area. This was accomplished by testing the height of the #branding wrapper, which would include the text, logo, etc. from the site, so that it would always appear in a "correct" position.

  /**
     * Fade in the user menu on page load and match the line height to the height of the #branding element
     */
    var logo_height = gamma('#branding').height();
    var user_menu_height = gamma('#user-menu').height();
    var useMargin = Math.round((logo_height - user_menu_height) / 2);
    gamma('#user-menu').css('margin-top', useMargin).fadeIn('fast');

However, in Chrome & Safari, when using a full page refresh, the menu would appear half off the page at the top because it was not properly detecting the height of the branding wrapper. If in either browser, you would refresh, then click on the logo or home links, the menu pops to the right position as the browser detects the height of the logo in cache, and then works.

I'm not sure the best solution to this issue without forcing it to a certain position, and removing the jQuery entirely for this.
But for now, I've simply added a JS conditional to check to see if the branding height < user_menu_height and then making it a default 60px value for the logo for the following calculations.

/**
     * Fade in the user menu on page load and match the line height to the height of the #branding element
     */
    var logo_height = gamma('#branding').height();
    var user_menu_height = gamma('#user-menu').height();
    if (logo_height < user_menu_height) {
    	logo_height = 60;
    }
    var useMargin = Math.round((logo_height - user_menu_height) / 2);
    gamma('#user-menu').css('margin-top', useMargin).fadeIn('fast');

If someone has a more elegant solution to this, I'd be happy to see it, test it out.

Comments

himerus’s picture

Status: Active » Fixed

this has been committed and will be tagged in the next official D7 release.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.