mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-14 18:52:05 +03:00
18 lines
470 B
JavaScript
18 lines
470 B
JavaScript
import Ember from 'ember';
|
|
|
|
Ember.LinkComponent.reopen({
|
|
active: Ember.computed('attrs.params', '_routing.currentState', function () {
|
|
var isActive = this._super();
|
|
|
|
if (typeof this.attrs.alternateActive === 'function') {
|
|
this.attrs.alternateActive(isActive);
|
|
}
|
|
|
|
return isActive;
|
|
}),
|
|
|
|
activeClass: Ember.computed('tagName', function () {
|
|
return this.get('tagName') === 'button' ? '' : 'active';
|
|
})
|
|
});
|