Worked out a better way to handle the phrases in the words table
This commit is contained in:
parent
fb7c8f193b
commit
24fca6f8b9
|
@ -1,14 +1,7 @@
|
||||||
{{#each this.phraseWords as |pw|}}
|
{{#each this.phraseWords as |pw|}}
|
||||||
{{#if pw.rootRow}}
|
{{#if pw.rootRow}}
|
||||||
<tr class="{{this.selected}}" ...attributes>
|
<Words::WordRow @model={{pw}} @rowspan={{this.rowCount}} />
|
||||||
<td rowspan="{{this.rowCount}}">{{pw.ulb}}</td>
|
|
||||||
<td>{{pw.greek}}</td>
|
|
||||||
<td>{{pw.morph}}</td>
|
|
||||||
</tr>
|
|
||||||
{{else}}
|
{{else}}
|
||||||
<tr {{on "click" (fn this.select pw)}} class="{{this.selected}}" ...attributes>
|
<Words::WordRow @model={{pw}} @isPartial={{true}} />
|
||||||
<td>{{pw.greek}}</td>
|
|
||||||
<td>{{pw.morph}}</td>
|
|
||||||
</tr>
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
import WordsWordRowComponent from "./word-row";
|
import Component from '@glimmer/component';
|
||||||
import { tracked } from "@glimmer/tracking";
|
import { tracked } from "@glimmer/tracking";
|
||||||
|
|
||||||
export default class WordsPhraseRowComponent extends WordsWordRowComponent {
|
|
||||||
|
export default class WordsPhraseRowComponent extends Component {
|
||||||
@tracked phraseWords = [];
|
@tracked phraseWords = [];
|
||||||
|
|
||||||
constructor(...args) {
|
constructor(...args) {
|
||||||
|
|
|
@ -1,5 +1,15 @@
|
||||||
|
{{#if @model.rootRow}}
|
||||||
|
<tr {{on "click" (fn this.select @model)}} ...attributes>
|
||||||
|
<td rowspan="{{@rowspan}}">{{@model.ulb}}</td>
|
||||||
|
<td class="{{this.selected}}">{{@model.greek}}</td>
|
||||||
|
<td class="{{this.selected}}">{{@model.morph}}</td>
|
||||||
|
</tr>
|
||||||
|
{{else}}
|
||||||
<tr {{on "click" (fn this.select @model)}} class="{{this.selected}}" ...attributes>
|
<tr {{on "click" (fn this.select @model)}} class="{{this.selected}}" ...attributes>
|
||||||
|
{{#if this.isNotPhrasePartial}}
|
||||||
<td>{{@model.ulb}}</td>
|
<td>{{@model.ulb}}</td>
|
||||||
|
{{/if}}
|
||||||
<td>{{@model.greek}}</td>
|
<td>{{@model.greek}}</td>
|
||||||
<td>{{@model.morph}}</td>
|
<td>{{@model.morph}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
{{/if}}
|
||||||
|
|
|
@ -21,4 +21,13 @@ export default class WordsWordRowComponent extends Component {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get
|
||||||
|
isNotPhrasePartial() {
|
||||||
|
if (this.args.isPartial == true) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,8 @@ table.word-details td {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
table.word-details tr.selected {
|
table.word-details tr.selected,
|
||||||
|
table.word-details td.selected {
|
||||||
background-color: lightblue;
|
background-color: lightblue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue