mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 22:43:30 +03:00
ad5528b078
closes TryGhost/Ghost#9477 - remove ember-invoke-action in favor of straight function calls
19 lines
538 B
JavaScript
19 lines
538 B
JavaScript
import LinkComponent from '@ember/routing/link-component';
|
|
import {computed} from '@ember/object';
|
|
|
|
LinkComponent.reopen({
|
|
active: computed('attrs.params', '_routing.currentState', function () {
|
|
let isActive = this._super(...arguments);
|
|
|
|
if (typeof this.get('alternateActive') === 'function') {
|
|
this.get('alternateActive')(isActive);
|
|
}
|
|
|
|
return isActive;
|
|
}),
|
|
|
|
activeClass: computed('tagName', function () {
|
|
return this.get('tagName') === 'button' ? '' : 'active';
|
|
})
|
|
});
|