forked from WycliffeAssociates/en_btr_frontend
Add click handling to the word details table
This commit is contained in:
parent
f89cafa4d7
commit
1458fa70cc
|
@ -1,4 +1,4 @@
|
|||
<tr data-strongs={{@model.strongsNumber}} class="{{this.selected}}" ...attributes>
|
||||
<tr {{on "click" (fn this.select @model)}} class="{{this.selected}}" ...attributes>
|
||||
<td>{{@model.greek}}</td>
|
||||
<td>{{@model.ulb}}</td>
|
||||
<td>{{@model.morph}}</td>
|
||||
|
|
|
@ -1,12 +1,19 @@
|
|||
import Component from '@glimmer/component';
|
||||
import { inject as service } from '@ember/service';
|
||||
import { action } from '@ember/object';
|
||||
|
||||
|
||||
export default class WordsWordRowComponent extends Component {
|
||||
@service('word-select') selectedWord;
|
||||
@service('word-select') selectWord;
|
||||
|
||||
@action
|
||||
select(word) {
|
||||
this.selectWord.select(word);
|
||||
}
|
||||
|
||||
get
|
||||
selected() {
|
||||
if(this.selectedWord.isCurrentByOgntId(this.args.model)) {
|
||||
if(this.selectWord.isCurrentByOgntId(this.args.model)) {
|
||||
return "selected";
|
||||
} else {
|
||||
return "";
|
||||
|
|
|
@ -6,6 +6,7 @@ table.word-details th,
|
|||
table.word-details td {
|
||||
border: 1px solid grey;
|
||||
padding: 10px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
table.word-details tr.selected {
|
||||
|
|
Loading…
Reference in New Issue