From 6d56b2791f16a80f4dbe937a83049b1a488d4c70 Mon Sep 17 00:00:00 2001 From: Aleksandr Kanunnikov Date: Sun, 1 Nov 2020 23:06:48 +0300 Subject: [PATCH] fixed 800 issue for ember --- frameworks/keyed/ember/app/components/my-table.js | 9 --------- .../keyed/ember/app/components/table-row/template.hbs | 2 +- .../keyed/ember/app/templates/components/my-table.hbs | 2 +- frameworks/keyed/ember/app/utils/benchmark-helpers.js | 5 +---- 4 files changed, 3 insertions(+), 15 deletions(-) diff --git a/frameworks/keyed/ember/app/components/my-table.js b/frameworks/keyed/ember/app/components/my-table.js index 412a38341..2d27816c5 100755 --- a/frameworks/keyed/ember/app/components/my-table.js +++ b/frameworks/keyed/ember/app/components/my-table.js @@ -48,20 +48,11 @@ export default class MyTable extends Component { } @action remove(id) { - const selected = this.data.find(({selected}) => selected === true); - if (selected) { - selected.selected = false; - } this.data = deleteRow(this.data, id); this.selected = undefined; } @action select(id) { this.selected = id; - const selected = this.data.find(({selected}) => selected === true); - if (selected) { - selected.selected = false; - } - this.data.find((item)=>item.id === id).selected = true; } } diff --git a/frameworks/keyed/ember/app/components/table-row/template.hbs b/frameworks/keyed/ember/app/components/table-row/template.hbs index 4c9f8d562..0fb2ca05a 100644 --- a/frameworks/keyed/ember/app/components/table-row/template.hbs +++ b/frameworks/keyed/ember/app/components/table-row/template.hbs @@ -1,5 +1,5 @@ {{!-- template-lint-disable --}} - + {{@item.id}} {{@item.label}} diff --git a/frameworks/keyed/ember/app/templates/components/my-table.hbs b/frameworks/keyed/ember/app/templates/components/my-table.hbs index 3765a79f6..4e359db2b 100755 --- a/frameworks/keyed/ember/app/templates/components/my-table.hbs +++ b/frameworks/keyed/ember/app/templates/components/my-table.hbs @@ -43,7 +43,7 @@ {{#if this.data.length}} - + {{/if}} diff --git a/frameworks/keyed/ember/app/utils/benchmark-helpers.js b/frameworks/keyed/ember/app/utils/benchmark-helpers.js index 34b48bac1..34201c71b 100644 --- a/frameworks/keyed/ember/app/utils/benchmark-helpers.js +++ b/frameworks/keyed/ember/app/utils/benchmark-helpers.js @@ -2,11 +2,9 @@ import { tracked } from '@glimmer/tracking'; class TodoItem { @tracked label; - @tracked selected; @tracked id - constructor({label,selected, id}) { + constructor({label, id}) { this.label = label; - this.selected = selected; this.id = id; } } @@ -43,7 +41,6 @@ export const buildData = (id, count = 1000) => { for (var i = 0; i < count; i++) data.push(new TodoItem({ id: id++, - selected: false, label: adjectives[_random(adjectives.length)] + " " + colours[_random(colours.length)]