Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix hidden responsive sidebar issue / Move X-UA-Compatible meta tag to be first #12

Merged
merged 2 commits into from
Sep 6, 2014
Merged

Conversation

johnnyreilly
Copy link
Contributor

Hi John,

This PR addresses 2 issues.

Fix vanishing responsive sidebar

The responsive sidebar vanishes in these circumstances:

  1. You shrink the viewport size down so the mobile view is triggered
  2. You open and then close the menu
  3. You grow the viewport size so the desktop view is triggered.

This happens because in the sidebar directive the sidebar-inner element gets set to display:none as a result of the $sidebarInner.slideUp(350). This fix adds a single media query to force the visibility of the sidebar-inner element when in desktop view.

@media (min-width: 768px) {
  .sidebar .sidebar-inner {
    display: block !important;
  }
}

Preventing Compatibility-mode triggering in IE

I've noticed that the <meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1" /> tag sits after a style tag in the template. This should mean that the tag will be ineffective - see MSDN:

The X-UA-Compatible header isn't case sensitive; however, it must appear in the header of the webpage (the HEAD section) before all other elements except for the title element and other meta elements. - Full text here

The simple fix is to amend the template from this:

    <style>
        /* This helps the ng-show/ng-hide animations start at the right place. */
        /* Since Angular has this but needs to load, this gives us the class early. */
        .ng-hide {
            display: none !important;
        }
    </style>
    <title data-ng-bind="title">Hot Towel Angular</title>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1" />

To this:

    <meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1" />
    <style>
        /* This helps the ng-show/ng-hide animations start at the right place. */
        /* Since Angular has this but needs to load, this gives us the class early. */
        .ng-hide {
            display: none !important;
        }
    </style>
    <title data-ng-bind="title">Hot Towel Angular</title>
    <meta charset="utf-8" />

ie. Simply moving the meta tag above the <style tag. It's a little thing, but if you've been bitten by Compatibility mode (I have 馃憥) it can be painful....

Best,
John

@johnnyreilly johnnyreilly changed the title Move X-UA-Compatible meta tag to be first Fix hidden responsive sidebar issue / Move X-UA-Compatible meta tag to be first Jul 14, 2014
johnpapa added a commit that referenced this pull request Sep 6, 2014
Fix hidden responsive sidebar issue / Move X-UA-Compatible meta tag to be first
@johnpapa johnpapa merged commit 018ee91 into johnpapa:master Sep 6, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants