2020-10-04 21:58:28 +00:00
|
|
|
import Component from '@glimmer/component';
|
|
|
|
import { action } from '@ember/object';
|
2020-12-18 18:16:05 +00:00
|
|
|
import { inject as service } from '@ember/service';
|
2020-10-04 21:58:28 +00:00
|
|
|
|
|
|
|
export default class VerseComponent extends Component {
|
2020-12-18 18:16:05 +00:00
|
|
|
@service('nav-state') navState;
|
|
|
|
|
|
|
|
|
2020-10-04 21:58:28 +00:00
|
|
|
@action
|
|
|
|
selectVerse() {
|
|
|
|
this.args.verseSelected(this.args.book, this.args.chapter, this.args.verse);
|
2020-12-18 18:16:05 +00:00
|
|
|
this.navState.setVerse(this.args.verse);
|
|
|
|
}
|
|
|
|
|
|
|
|
get
|
|
|
|
selected() {
|
|
|
|
if(this.navState.isCurrentVerse(this.args.verse)) {
|
|
|
|
return "selected";
|
|
|
|
} else {
|
|
|
|
return "";
|
|
|
|
}
|
2020-10-04 21:58:28 +00:00
|
|
|
}
|
|
|
|
}
|