From cecfce8597dc528a74768c1a4c096aef70934ecc Mon Sep 17 00:00:00 2001 From: Leonard Smith Date: Fri, 21 May 2021 06:16:39 -0500 Subject: [PATCH] Handle sorting the Greek and Ulb texts --- app/components/words/greek-text.hbs | 2 +- app/components/words/greek-text.js | 7 +++++++ app/components/words/ulb-text.js | 7 +++++++ 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 app/components/words/greek-text.js create mode 100644 app/components/words/ulb-text.js diff --git a/app/components/words/greek-text.hbs b/app/components/words/greek-text.hbs index d899541..4443a6d 100644 --- a/app/components/words/greek-text.hbs +++ b/app/components/words/greek-text.hbs @@ -1,5 +1,5 @@
- {{#each @model as |word|}} + {{#each this.sortedWords as |word|}} {{/each}}
\ No newline at end of file diff --git a/app/components/words/greek-text.js b/app/components/words/greek-text.js new file mode 100644 index 0000000..bb192f0 --- /dev/null +++ b/app/components/words/greek-text.js @@ -0,0 +1,7 @@ +import Component from '@glimmer/component'; +import { sort } from '@ember/object/computed'; + +export default class WordsGreekTextComponent extends Component { + sortDefinition = ['ogntSort']; + @sort('args.model', 'sortDefinition') sortedWords; +} diff --git a/app/components/words/ulb-text.js b/app/components/words/ulb-text.js new file mode 100644 index 0000000..d53182d --- /dev/null +++ b/app/components/words/ulb-text.js @@ -0,0 +1,7 @@ +import Component from '@glimmer/component'; +import { sort } from '@ember/object/computed'; + +export default class WordsUlbTextComponent extends Component { + sortDefinition = ['ulbSort']; + @sort('args.model', 'sortDefinition') sortedWords; +}