en_btr_frontend/app/components/chapter.js

25 lines
569 B
JavaScript
Raw Permalink Normal View History

2020-10-04 21:58:28 +00:00
import Component from '@glimmer/component';
2020-10-05 04:06:09 +00:00
import { tracked } from "@glimmer/tracking";
2020-10-04 21:58:28 +00:00
import { action } from '@ember/object';
import { inject as service } from '@ember/service';
2020-10-04 21:58:28 +00:00
export default class ChapterComponent extends Component {
@service('nav-state') navState;
2020-10-04 21:58:28 +00:00
@action
selectChapter() {
this.args.showVerses(this.args.book, this.args.chapter);
this.navState.setChapter(this.args.chapter);
}
get
selected() {
if(this.navState.isCurrentChapter(this.args.chapter)) {
return "selected";
} else {
return "";
}
2020-10-04 21:58:28 +00:00
}
}