mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-01 15:29:19 +03:00
983110d931
no issue - add eslint-plugin-ember, configure no-old-shims rule - run `eslint --fix` on `app`, `lib`, `mirage`, and `tests` to move imports to the new module imports - further cleanup of Ember globals usage - remove event-dispatcher initializer now that `canDispatchToEventManager` is deprecated
20 lines
598 B
JavaScript
20 lines
598 B
JavaScript
import LinkComponent from '@ember/routing/link-component';
|
|
import {computed} from '@ember/object';
|
|
import {invokeAction} from 'ember-invoke-action';
|
|
|
|
LinkComponent.reopen({
|
|
active: computed('attrs.params', '_routing.currentState', function () {
|
|
let isActive = this._super(...arguments);
|
|
|
|
if (typeof this.get('alternateActive') === 'function') {
|
|
invokeAction(this, 'alternateActive', isActive);
|
|
}
|
|
|
|
return isActive;
|
|
}),
|
|
|
|
activeClass: computed('tagName', function () {
|
|
return this.get('tagName') === 'button' ? '' : 'active';
|
|
})
|
|
});
|