en_btr_frontend/app/components/verse.js

24 lines
532 B
JavaScript

import Component from '@glimmer/component';
import { action } from '@ember/object';
import { inject as service } from '@ember/service';
export default class VerseComponent extends Component {
@service('nav-state') navState;
@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 "";
}
}
}