Fixed "Copy card link to clipboard" icon often not working.

Thanks to brlin-tw and xet7 !

Fixes #6068
This commit is contained in:
Lauri Ojansivu 2026-01-18 15:21:33 +02:00
parent 4473ca09f6
commit d337afd5d3
3 changed files with 8 additions and 5 deletions

View file

@ -423,7 +423,8 @@ BlazeComponent.extendComponent({
},
'click .js-copy-link'(event) {
event.preventDefault();
const promise = Utils.copyTextToClipboard(event.target.href);
const url = this.data().absoluteUrl();
const promise = Utils.copyTextToClipboard(url);
const $tooltip = this.$('.card-details-header .copied-tooltip');
Utils.showCopied(promise, $tooltip);

View file

@ -1067,10 +1067,10 @@ Boards.helpers({
},
absoluteUrl() {
return FlowRouter.url('board', { id: this._id, slug: this.slug });
return FlowRouter.url('board', { id: this._id, slug: this.slug || 'board' });
},
originRelativeUrl() {
return FlowRouter.path('board', { id: this._id, slug: this.slug });
return FlowRouter.path('board', { id: this._id, slug: this.slug || 'board' });
},
colorClass() {

View file

@ -1019,17 +1019,19 @@ Cards.helpers({
absoluteUrl() {
const board = this.board();
if (!board) return undefined;
return FlowRouter.url('card', {
boardId: board._id,
slug: board.slug,
slug: board.slug || 'board',
cardId: this._id,
});
},
originRelativeUrl() {
const board = this.board();
if (!board) return undefined;
return FlowRouter.path('card', {
boardId: board._id,
slug: board.slug,
slug: board.slug || 'board',
cardId: this._id,
});
},