Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ There are several options available to adjust functionality:
| linkSelector | 'a.ember-view' | jQuery selector for child `{{link-to}}`'s |
| activeClass | _Computed_** | Class name to apply when any child `{{link-to}}` is also active |
| disabledClass | _Computed_** | Class name to apply when ALL child `{{link-to}}`'s are disabled |
| disable | null | Boolean: ignore children and apply the disabled class |

** Default class names are pulled from the child `{{link-to}}`,
which in turn defaults to 'active'. You can change it on either
Expand Down Expand Up @@ -102,6 +103,21 @@ even if child `{{link-to}}`'s are active/disabled.
</li>
```

The the parent element can be forcibly disabled
by passing a boolean `true` for disabled.

```hbs
{{#active-link disabled=true}}
{{link-to "Index" "index"}}
{{/active-link}}
```

```html
<li class"disabled">
<a href="/" class="active">Index</a>
</li>
```

If the child `{{link-to}}`'s have their `tagName` changed,
be sure to adjust the selector. Always include the `.ember-view`
class since all link-to's apply that class.
Expand Down
2 changes: 1 addition & 1 deletion addon/mixins/active-link.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export default Ember.Mixin.create({
}),

_disabled: Ember.computed('allLinksDisabled', 'disabledClass', function(){
return (this.get('allLinksDisabled') ? this.get('disabledClass') : false);
return (this.get('disabled') || this.get('allLinksDisabled') ? this.get('disabledClass') : false);
})

});