Created
June 5, 2014 07:02
-
-
Save michiel/c04bcd8c16ea18cbab68 to your computer and use it in GitHub Desktop.
bootstrap isActive link/li component
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Bootstrap3 | |
App.ActiveLiComponent = Ember.Component.extend({ | |
tagName : 'li', | |
classNameBindings : ['isActive:active:inactive'], | |
router: function() { | |
return this.container.lookup('router:main'); | |
}.property(), | |
isActive: function() { | |
var currentWhen = this.get('currentWhen'); | |
return this.get('router').isActive(currentWhen); | |
}.property('router.url', 'currentWhen') | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment