en_btr_frontend/app/components/verse.js

24 lines
532 B
JavaScript
Raw Normal View History

2020-10-04 21:58:28 +00:00
import Component from '@glimmer/component';
import { action } from '@ember/object';
import { inject as service } from '@ember/service';
2020-10-04 21:58:28 +00:00
export default class VerseComponent extends Component {
@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);
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
}
}