Ghost/ghost/admin/app/utils/link-component.js
Austin Burdine ad5528b078 Remove ember-invoke-action (#978)
closes TryGhost/Ghost#9477
- remove ember-invoke-action in favor of straight function calls
2018-03-20 14:57:59 +00:00

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';
})
});