en_btr_frontend/app/components/chapter-nav.js

27 lines
569 B
JavaScript

import Component from '@glimmer/component';
import { action } from '@ember/object';
import { tracked } from "@glimmer/tracking";
import { inject as service } from '@ember/service';
export default class ChapterNavComponent extends Component {
@tracked currentChapter;
@service('nav-state') navState;
constructor(...args) {
super(...args);
}
@action
showVerses(book, chapter)
{
this.args.showVerses(book, chapter);
this.currentChapter = chapter;
}
@action
isChapterActive(chapter)
{
return chapter === this.currentChapter;
}
}