UI-TOPBAR is a reponsive bar component that relies on modern css flexbox for positioning of branding and menu elements within a top bar on desktop systems. On touch devices,
it behaves as a drawer menu.
IMPORTANT:
both ui-topbar and ui-navbar must be wrapped by a ui-container element for the touch drawer to work correctly.
```html
```
Markup
```html
My Brand
My Brand
```
SEARCH
UI-SEARCH elements in touch-header or input elements with the attribute [role="search"] generate automatic listeners
TOUCH SEARCH
touch-header>ui-search
DESKTOP SEARCH
input with role attribute=search
SEARCH EVENT FIRED
ui.[topbar].search
```html
```
UI-NAVBAR
UI-NAVBAR is a reponsive, composite navigation component. On touch devices, it behaves as a drawer menu.
Markup
```html
```
TOUCH-UI-DRAWER
TOUCH-UI-DRAWER is dynamically added to the DOM by the navigation components...it is not created from markup. The component will clone
touch-drawer markup to the drawer.
```html
```
TOUCH-UI-DRAWER populates the drawer by cloning UI-MENU items to TOUCH-UI-MENU.
MENUS AND DROPDOWNS
UI-MENUs are used to present navigation menu options. MENU-ITEM-DROPDOWN presents a menu dropdown on css hover.
User UI-DRODOWN for a simple dropdown list. Use UI-MEGA-DROPDOWN for a custom dropdown presentation.
UI-MENUs are automatically cloned to the mobile drawer.
a UI-MENU with attribute [touch-menu="false"] will not be added to the drawer.
a MENU-ITEM, MENU-ITEM-DROPDOWN with attribute [touch-menu-item="false"] will not be added to the drawer.
```html
```
TOUCH EVENTS
By default, UI-TOPBAR and UI-NAVBAR components will handle touch menu links. This is done to deliver the effect of closing the drawer before
the http resource request is made. This however can introduce issues for single page applications where delegated get requests are handled by an
external routing framework. You can keep this behavior and yet handle routing requests by setting window._location to your own service/singleton that
implements an 'href' setter.
IMPLEMENT TOUCH MENU HREF
window._location=MyService;
where MyService.href implements an href setter
Alternatively, you can simply disable the behavior by setting the attribute disableTouchEvents="true". You then will need to manually handle closing the drawer.
```html
```
DISABLE TOUCH MENU EVENTS
disableTouchEvents=true
SELECTIVELY DISABLING TOUCH EVENTS
You can also selectively disable touch events by setting a data-ignore attribute on the "a" tag. For example, this might be done for external linking in a new window
```html
```
SELECTIVE DISABLING TOUCH MENU EVENTS
a[data-ignore]
BRAND HOME LINK
Setting a [home] attribute on the navigation brand/logo will trigger an automatic listener to for the home link specified in the homeUrl property
```html
My Brand
```
BRAND HOME LINK
set homeUrl attribute on the component
place a [home] attribute on any child element to trigger the listener
UI-DRAWER-PANEL
UI-DRAWER-PANEL is a mobile-first composite navigation component. This component however does not clone menu elements to the drawer. Additionally,
the drawer toggle is visible on desktop screen and devices.
DRAWER
The drawer panel must be marked with a [drawer] attribute.
PROPERTIES
Public Properties
transformDuration{Numeric}touch menu slide duration(ms)default:250transformDelay{Numeric}activation delay when pressing ui-toggledefault:0translateX{String}drawer translation distancedefault:260pxoverlayOpacity{Number}opacity of overlay when showing drawerdefault:.5overlayBackground{String}overlay backgrounddefault:#000overlayOpenDuration{Number}overlay show durationdefault:0overlayCloseDuration{Number}overlay hide durationdefault:150includeHome{Boolean}adds a home link to the top of the drawer menudefault:truehomeUrl{String}home urldefault:truehomeIcon{String}home menu icondefault:nulldisableTouchEvents{Boolean}disable touch menu href handled by the componentdefault:falsemenu{Array}menu items model added to the drawerModel[{ {String}icon, {String}label, {String}url, {Array}dropdown }]dropdown[{ {String}label, {String}url }]default:[]easing{String}drawer easing animationdefault:ease-in-outcloneDelay{Number}delay touch drawer is cloned from the DOMdefault:750touchDelay{Number}delay tap triggers drawer paneldefault:50
METHODS
Public Methods
show{void}show the drawerparams: nonehide{void}hide the drawerparams: noneaddMenuModel{void}add menu items to the drawerparams:{Array} model
EVENTS
Public Events
ui.[navbar].hidethrown when drawer is hiddenui.[navbar].showthrown when drawer is shownui.[navbar].searchthrown when search is submitted