From bbaa19e666df4fcdec228b97f3d56c8a85dba7c0 Mon Sep 17 00:00:00 2001 From: Sam Van Campenhout Date: Tue, 12 Nov 2024 13:42:24 +0100 Subject: [PATCH] Remove action from the data-table-content-body component --- addon/components/data-table-content-body.js | 24 +++++++++---------- .../components/data-table-content-body.hbs | 3 ++- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/addon/components/data-table-content-body.js b/addon/components/data-table-content-body.js index f143fac..73d98f1 100644 --- a/addon/components/data-table-content-body.js +++ b/addon/components/data-table-content-body.js @@ -1,5 +1,5 @@ import { set } from '@ember/object'; -import { computed } from '@ember/object'; +import { action, computed } from '@ember/object'; import Component from '@ember/component'; import layout from '../templates/components/data-table-content-body'; @@ -32,16 +32,14 @@ export default Component.extend({ }); } ), - actions: { - updateSelection(selectedWrapper, event) { - set(selectedWrapper, 'isSelected', event.target.checked); - this.wrappedItems.forEach((wrapper) => { - if (wrapper.isSelected) { - this.get('data-table').addItemToSelection(wrapper.item); - } else { - this.get('data-table').removeItemFromSelection(wrapper.item); - } - }); - }, - }, + updateSelection: action(function (selectedWrapper, event) { + set(selectedWrapper, 'isSelected', event.target.checked); + this.wrappedItems.forEach((wrapper) => { + if (wrapper.isSelected) { + this.get('data-table').addItemToSelection(wrapper.item); + } else { + this.get('data-table').removeItemFromSelection(wrapper.item); + } + }); + }), }); diff --git a/addon/templates/components/data-table-content-body.hbs b/addon/templates/components/data-table-content-body.hbs index 38c5bbb..ab8bbe7 100644 --- a/addon/templates/components/data-table-content-body.hbs +++ b/addon/templates/components/data-table-content-body.hbs @@ -6,7 +6,8 @@ {{#if this.enableSelection}} - + hello + {{/if}} {{#if this.enableLineNumbers}}