From 24fca6f8b9071fa63349832f30a45a65e9a17369 Mon Sep 17 00:00:00 2001 From: Leonard Smith Date: Wed, 5 May 2021 20:26:21 -0500 Subject: [PATCH] Worked out a better way to handle the phrases in the words table --- app/components/words/phrase-row.hbs | 11 ++--------- app/components/words/phrase-row.js | 5 +++-- app/components/words/word-row.hbs | 20 +++++++++++++++----- app/components/words/word-row.js | 9 +++++++++ app/styles/components/words.scss | 3 ++- 5 files changed, 31 insertions(+), 17 deletions(-) diff --git a/app/components/words/phrase-row.hbs b/app/components/words/phrase-row.hbs index eb04e30..de527e5 100644 --- a/app/components/words/phrase-row.hbs +++ b/app/components/words/phrase-row.hbs @@ -1,14 +1,7 @@ {{#each this.phraseWords as |pw|}} {{#if pw.rootRow}} - - {{pw.ulb}} - {{pw.greek}} - {{pw.morph}} - + {{else}} - - {{pw.greek}} - {{pw.morph}} - + {{/if}} {{/each}} diff --git a/app/components/words/phrase-row.js b/app/components/words/phrase-row.js index 7f557db..3c217f2 100644 --- a/app/components/words/phrase-row.js +++ b/app/components/words/phrase-row.js @@ -1,7 +1,8 @@ -import WordsWordRowComponent from "./word-row"; +import Component from '@glimmer/component'; import { tracked } from "@glimmer/tracking"; -export default class WordsPhraseRowComponent extends WordsWordRowComponent { + +export default class WordsPhraseRowComponent extends Component { @tracked phraseWords = []; constructor(...args) { diff --git a/app/components/words/word-row.hbs b/app/components/words/word-row.hbs index 1e865ca..f49e3e8 100644 --- a/app/components/words/word-row.hbs +++ b/app/components/words/word-row.hbs @@ -1,5 +1,15 @@ - - {{@model.ulb}} - {{@model.greek}} - {{@model.morph}} - \ No newline at end of file +{{#if @model.rootRow}} + + {{@model.ulb}} + {{@model.greek}} + {{@model.morph}} + +{{else}} + + {{#if this.isNotPhrasePartial}} + {{@model.ulb}} + {{/if}} + {{@model.greek}} + {{@model.morph}} + +{{/if}} diff --git a/app/components/words/word-row.js b/app/components/words/word-row.js index 6816e2a..286c42d 100644 --- a/app/components/words/word-row.js +++ b/app/components/words/word-row.js @@ -21,4 +21,13 @@ export default class WordsWordRowComponent extends Component { return ""; } } + + get + isNotPhrasePartial() { + if (this.args.isPartial == true) { + return false; + } else { + return true; + } + } } diff --git a/app/styles/components/words.scss b/app/styles/components/words.scss index 6d9cc74..9e7fc41 100644 --- a/app/styles/components/words.scss +++ b/app/styles/components/words.scss @@ -9,7 +9,8 @@ table.word-details td { cursor: pointer; } -table.word-details tr.selected { +table.word-details tr.selected, +table.word-details td.selected { background-color: lightblue; }