Skip to content

Commit

Permalink
fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
roncodes committed Aug 26, 2024
1 parent 9bc4a9b commit 1617035
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions addon/components/layout/sidebar/item.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default class LayoutSidebarItemComponent extends Component {
@tracked doesntHavePermissions = false;
@tracked visible = true;

constructor (owner, { dropdownButtonRenderInPlace = true, permission = null, disabled = false, visible = true }) {
constructor(owner, { dropdownButtonRenderInPlace = true, permission = null, disabled = false, visible = true }) {
super(...arguments);

this.active = this.checkIfActive();
Expand All @@ -34,17 +34,17 @@ export default class LayoutSidebarItemComponent extends Component {
router.on('routeDidChange', this.trackActiveFlag);
}

willDestroy () {
willDestroy() {
super.willDestroy(...arguments);
const router = this.getRouter();
router.off('routeDidChange', this.trackActiveFlag);
}

@action trackActiveFlag () {
@action trackActiveFlag() {
this.active = this.checkIfActive();
}

@action checkIfActive () {
@action checkIfActive() {
const { route, onClick, item, model } = this.args;
const router = this.getRouter();
const currentRoute = router.currentRouteName;
Expand Down Expand Up @@ -73,7 +73,7 @@ export default class LayoutSidebarItemComponent extends Component {
return isCurrentRoute;
}

@action onClick (event) {
@action onClick(event) {
if (this.isPointerWithinDropdownButton(event)) {
event.preventDefault();
return;
Expand Down Expand Up @@ -122,7 +122,7 @@ export default class LayoutSidebarItemComponent extends Component {
}
}

@action onDropdownItemClick (action, dd) {
@action onDropdownItemClick(action, dd) {
const context = this.getDropdownContext(action);

if (typeof dd.actions === 'object' && typeof dd.actions.close === 'function') {
Expand All @@ -138,7 +138,7 @@ export default class LayoutSidebarItemComponent extends Component {
}
}

getDropdownContext (action) {
getDropdownContext(action) {
let context = null;

if (action && action.context) {
Expand All @@ -152,13 +152,13 @@ export default class LayoutSidebarItemComponent extends Component {
return context;
}

@action onRegisterAPI () {
@action onRegisterAPI() {
if (typeof this.args.registerAPI === 'function') {
this.args.registerAPI(...arguments);
}
}

@action onDropdownButtonInsert (dropdownButtonNode) {
@action onDropdownButtonInsert(dropdownButtonNode) {
if (dropdownButtonNode) {
this.dropdownButtonNode = dropdownButtonNode;

Expand All @@ -168,7 +168,7 @@ export default class LayoutSidebarItemComponent extends Component {
}
}

isPointerWithinDropdownButton ({ target }) {
isPointerWithinDropdownButton({ target }) {
const isTargetDropdownItem = target.classList.contains('next-dd-item');

if (this.dropdownButtonNode) {
Expand All @@ -183,7 +183,7 @@ export default class LayoutSidebarItemComponent extends Component {
return false;
}

getRouter () {
getRouter() {
return this.router ?? this.hostRouter;
}
}

0 comments on commit 1617035

Please sign in to comment.