From 90040fad1832487d702c5cc95c6a98b65111d18c Mon Sep 17 00:00:00 2001 From: "Ronald A. Richardson" Date: Thu, 30 May 2024 18:35:07 +0800 Subject: [PATCH] small patch to click to reveal --- addon/components/click-to-reveal.js | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/addon/components/click-to-reveal.js b/addon/components/click-to-reveal.js index d604b74..86995c9 100644 --- a/addon/components/click-to-reveal.js +++ b/addon/components/click-to-reveal.js @@ -26,14 +26,27 @@ export default class ClickToRevealComponent extends ClickToCopyComponent { @tracked timeout = 600; /** - * The loading state of the reveal process + * If click to copy should be enabled. * * @var {Boolean} */ - @computed('args.clickToCopy') get clickToCopy() { - const { clickToCopy } = this.args; + @tracked clickToCopy = false; - return clickToCopy ?? false; + /** + * Setup the component + * + * @param {EngineInstance} owner + * @param {...Arguments} { column, clickToCopy, } + * @memberof ClickToRevealComponent + */ + constructor(owner, { column, clickToCopy }) { + super(...arguments); + + this.clickToCopy = clickToCopy ?? false; + + if (column && column.cellComponentArgs) { + this.clickToCopy = column.cellComponentArgs.clickToCopy ?? false; + } } /**