Keeo / ember-cli-active-link-wrapper

Simple ember-cli link wrapper to propagate active class to parent element

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ember-cli-active-link-wrapper Ember Observer Score Build Status

A simple link wrapper to wrap active links in an element that inherits the link's active class. Useful for e.g. bootstrap where the active class should be on the containing li not on the a.

Usage

{{#active-link}}
  {{link-to "Index" "index"}}
{{/active-link}}

Produces (roughly) the markup:

<li class='active'>
    <a href="/" class='active'>Index</a>
</li>

You can change the tagName if you like, the default is li:

{{#active-link tagName='div'}}
  {{link-to "Index" "index"}}
{{/active-link}}
<div class='active'>
    <a href="/" class='active'>Index</a>
</div>

Installation

ember install:addon ember-cli-active-link-wrapper

Running

Running Tests

  • ember test
  • ember test --server

Building

  • ember build

For more information on using ember-cli, visit http://www.ember-cli.com/.

About

Simple ember-cli link wrapper to propagate active class to parent element

License:MIT License


Languages

Language:JavaScript 75.1%Language:HTML 23.8%Language:CSS 1.1%