aurelia-ui-toolkits / aurelia-materialize-bridge

Materialize CSS components for Aurelia
http://aurelia-ui-toolkits.github.io/demo-materialize/
MIT License
155 stars 52 forks source link

handle "global" side-nav and catalog's side-nav #117

Open Thanood opened 8 years ago

Thanood commented 8 years ago

On smaller screens, the top navigation items (About/Installation/Project Status/Help) are hidden and displayed in a side-nav instead.

The component catalog also brings its own side-nav with navigation to component samples.

These two side-navs don't work well together.

  1. component side-nav introduces a padding on the left edge which doesn't disappear oin small screens
  2. the global side-nav's hamburger icon button (how is that thing called really?) only shows that global side-nav
  3. the component side-nav is only accessible from the "samples" folder

Either merge these two side-navs into one global fixed side-nav or display one of them on the right edge instead of the left edge.

Right now, I'd prefer merging.

adriatic commented 8 years ago

All of our catalog apps are direct descendants of Aurelia Navigation Skeleton, which uses some of the Bootstrap features (navbar and layout on some pages).

<template bindable="router">
  <nav class="navbar navbar-default navbar-fixed-top" role="navigation">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#skeleton-navigation-navbar-collapse">
        <span class="sr-only">Toggle Navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="#">
        <i class="fa fa-home"></i>
        <span>${router.title}</span>
      </a>
    </div>

    <div class="collapse navbar-collapse" id="skeleton-navigation-navbar-collapse">
      <ul class="nav navbar-nav">
        <li repeat.for="row of router.navigation" class="${row.isActive ? 'active' : ''}">
          <a data-toggle="collapse" data-target="#skeleton-navigation-navbar-collapse.in" href.bind="row.href">${row.title}</a>
        </li>
      </ul>

      <ul class="nav navbar-nav navbar-right">
        <li class="loader" if.bind="router.isNavigating">
          <i class="fa fa-spinner fa-spin fa-2x"></i>
        </li>
      </ul>
    </div>
  </nav>
</template>

The Project status page uses the bootstrap row/col layout which also behaves as you described above.

Thanood commented 8 years ago

So, what would you do if you had two navbar-collapse? That is, if I got Bootstrap right (which need not be the case). Combine ("merge") them or put them in distinct places?

The point is really: how to best combine two different collapsing/collapsed navigation panels?

Btw: there is no Bootstrap in this bridge anymore. :smile:

(or is there something I didn't get?)