From 47174653244ad66717e974df96f0f0c5e1e6dd4e Mon Sep 17 00:00:00 2001 From: jorg-vr Date: Thu, 6 Jun 2024 14:04:07 +0200 Subject: [PATCH 1/2] Fix typo in copy container that broke copying --- app/assets/javascripts/components/copy_button.ts | 2 ++ app/assets/javascripts/components/copy_container.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/components/copy_button.ts b/app/assets/javascripts/components/copy_button.ts index 8af56b11db..72d6985261 100644 --- a/app/assets/javascripts/components/copy_button.ts +++ b/app/assets/javascripts/components/copy_button.ts @@ -24,6 +24,7 @@ export class CopyButton extends DodonaElement { _target: HTMLElement; @property({ type: Object }) get target(): HTMLElement { + console.log("target", this._target, document.getElementById(this.targetId)); return this._target ?? document.getElementById(this.targetId); } @@ -35,6 +36,7 @@ export class CopyButton extends DodonaElement { @property({ type: String }) get text(): string { + console.log("text", this._text, this.target?.textContent); return this._text ?? this.target?.textContent; } diff --git a/app/assets/javascripts/components/copy_container.ts b/app/assets/javascripts/components/copy_container.ts index 254b0279ce..36c4376ef9 100644 --- a/app/assets/javascripts/components/copy_container.ts +++ b/app/assets/javascripts/components/copy_container.ts @@ -24,6 +24,6 @@ export class CopyContainer extends DodonaElement { } protected render(): TemplateResult { - return html`
${this.content}
`; + return html`
${this.content}
`; } } From adce78710b4b0c493fb3a5c6a59935848e1e7128 Mon Sep 17 00:00:00 2001 From: jorg-vr Date: Thu, 6 Jun 2024 14:04:58 +0200 Subject: [PATCH 2/2] Remove logging --- app/assets/javascripts/components/copy_button.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/assets/javascripts/components/copy_button.ts b/app/assets/javascripts/components/copy_button.ts index 72d6985261..8af56b11db 100644 --- a/app/assets/javascripts/components/copy_button.ts +++ b/app/assets/javascripts/components/copy_button.ts @@ -24,7 +24,6 @@ export class CopyButton extends DodonaElement { _target: HTMLElement; @property({ type: Object }) get target(): HTMLElement { - console.log("target", this._target, document.getElementById(this.targetId)); return this._target ?? document.getElementById(this.targetId); } @@ -36,7 +35,6 @@ export class CopyButton extends DodonaElement { @property({ type: String }) get text(): string { - console.log("text", this._text, this.target?.textContent); return this._text ?? this.target?.textContent; }