Skip to content

Commit

Permalink
Since we're getting rid of ember math helpers elsewhere, do the math …
Browse files Browse the repository at this point in the history
…ourselves here
  • Loading branch information
philrenaud committed Jul 15, 2022
1 parent 5fa0b9a commit cf9c05f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions ui/app/components/app-breadcrumbs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import Component from '@glimmer/component';

export default class AppBreadcrumbsComponent extends Component {
isOneCrumbUp(iter = 0, totalNum = 0) {
return iter === totalNum - 2;
}
}
2 changes: 1 addition & 1 deletion ui/app/components/breadcrumbs/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ export default class BreadcrumbsTemplate extends Component {
}

get keyboardShortcut() {
return this.args.isOneCrumbUp ? KeyboardShortcutModifier : null;
return this.args.isOneCrumbUp() ? KeyboardShortcutModifier : null;
}
}
2 changes: 1 addition & 1 deletion ui/app/templates/components/app-breadcrumbs.hbs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Breadcrumbs as |breadcrumbs|>
{{#each breadcrumbs as |crumb iter|}}
{{#let crumb.args.crumb as |c|}}
{{component (concat "breadcrumbs/" (or c.type "default")) crumb=c isOneCrumbUp=(eq iter (sub breadcrumbs.length 2))}}
{{component (concat "breadcrumbs/" (or c.type "default")) crumb=c isOneCrumbUp=(action this.isOneCrumbUp iter breadcrumbs.length)}}
{{/let}}
{{/each}}
</Breadcrumbs>

0 comments on commit cf9c05f

Please sign in to comment.