ember-crumbly
Advanced tools
Comparing version 0.1.0 to 0.2.0
@@ -34,2 +34,3 @@ import Ember from 'ember'; | ||
linkable: true, | ||
reverse: false, | ||
classNameBindings: [ 'breadCrumbClass' ], | ||
@@ -39,3 +40,3 @@ hasBlock: computed.bool('template').readOnly(), | ||
routeHierarchy: computed('currentRouteName', { | ||
routeHierarchy: computed('currentRouteName', 'reverse', { | ||
get() { | ||
@@ -49,3 +50,4 @@ const currentRouteName = getWithDefault(this, 'currentRouteName', false); | ||
return this._lookupBreadCrumb(routeNames, filteredRouteNames); | ||
const crumbs = this._lookupBreadCrumb(routeNames, filteredRouteNames); | ||
return this.get('reverse') ? crumbs.reverse() : crumbs; | ||
}, | ||
@@ -52,0 +54,0 @@ |
{ | ||
"name": "ember-crumbly", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "Declarative breadcrumb navigation for Ember apps", | ||
@@ -22,3 +22,3 @@ "directories": { | ||
"broccoli-asset-rev": "^2.0.2", | ||
"ember-cli": "0.2.5", | ||
"ember-cli": "0.2.6", | ||
"ember-cli-app-version": "0.3.3", | ||
@@ -32,3 +32,3 @@ "ember-cli-content-security-policy": "0.4.0", | ||
"ember-disable-prototype-extensions": "^1.0.0", | ||
"ember-disable-proxy-controllers": "^0.7.0", | ||
"ember-disable-proxy-controllers": "^1.0.0", | ||
"ember-export-application-global": "^1.0.2", | ||
@@ -35,0 +35,0 @@ "ember-suave": "0.1.9", |
# ember-crumbly | ||
[![Build Status](https://travis-ci.org/poteto/ember-crumbly.svg)](https://travis-ci.org/poteto/ember-crumbly) | ||
[![npm version](https://badge.fury.io/js/ember-crumbly.svg)](http://badge.fury.io/js/ember-crumbly) [![Build Status](https://travis-ci.org/poteto/ember-crumbly.svg)](https://travis-ci.org/poteto/ember-crumbly) | ||
@@ -102,3 +102,7 @@ Adds a Component to your app that displays the current route hierarchy (commonly known as breadcrumb navigation). Thanks to [@rwjblue](https://github.com/rwjblue) for providing the excellent addon name. | ||
{{#bread-crumbs outputStyle='bootstrap" linkable=true as |component cow|}} | ||
{{cow.name}} ({{cow.age}}) says {{cow.says}} | ||
{{#if cow.title}} | ||
{{cow.title}} | ||
{{else}} | ||
{{cow.name}} ({{cow.age}}) says {{cow.says}} | ||
{{/if}} | ||
{{/bread-crumbs}} | ||
@@ -149,4 +153,4 @@ ``` | ||
#### Set different HTML | ||
The Component essentially generates a parent element, and iterates through the available routes in the hierarchy as child elements. By default, the parent element is a list `<ol>`, and the child element is a list item `<li>`. You can override this by passing in the appropriate `tagName` and `crumbName` to the Component: | ||
#### Set `li` classes | ||
You can set your own `li` classes by passing in the appropriate `crumbClass` to the Component: | ||
@@ -177,2 +181,11 @@ ```hbs | ||
#### Reversing the order of breadcrumb | ||
In certain scenarios, you might want to reverse the order of the breadcrumb (i.e. from RTL instead of LTR). To enable this, just set the `reverse` attr on the Component in your template: | ||
```hbs | ||
{{bread-crumbs linkable=true reverse=true}} | ||
``` | ||
Will generate the following breadcrumb: `Mary < Cows < Quadrupeds < Animals`. Note that you have to style this yourself (the Component is not responsible for generating the separators). | ||
## Installation | ||
@@ -179,0 +192,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13318
14
160
209