mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-10 23:36:14 -05:00
no issue - `this.attrs` is a glimmer-component thing (which doesn't exist in Ghost yet), to avoid confusion we should avoid using it - https://locks.svbtle.com/to-attrs-or-not-to-attrs - https://github.com/cibernox/ember-power-select/issues/233#issuecomment-170352572
19 lines
508 B
JavaScript
19 lines
508 B
JavaScript
import Ember from 'ember';
|
|
|
|
const {LinkComponent, computed} = Ember;
|
|
|
|
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';
|
|
})
|
|
});
|