From fecb9cdb669428fddec90ead346ec3b4070bf786 Mon Sep 17 00:00:00 2001 From: Martin Filser Date: Mon, 25 Oct 2021 00:27:54 +0200 Subject: [PATCH 1/4] Popup#afterConfirm popup broke features like "Archiv Cards", "Upload Attachements" and so on -> fixed --- client/components/cards/minicard.js | 2 +- client/lib/popup.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/client/components/cards/minicard.js b/client/components/cards/minicard.js index 796ce6a6a..a74397b93 100644 --- a/client/components/cards/minicard.js +++ b/client/components/cards/minicard.js @@ -55,7 +55,7 @@ BlazeComponent.extendComponent({ */ cardLabelsPopup(event) { if (this.find('.js-card-label:hover')) { - Popup.open("cardLabels")(event, this.currentData()); + Popup.open("cardLabels")(event, {dataContextIfCurrentDataIsUndefined: this.currentData()}); } }, diff --git a/client/lib/popup.js b/client/lib/popup.js index 1e4dfa68a..01f34f92a 100644 --- a/client/lib/popup.js +++ b/client/lib/popup.js @@ -32,9 +32,9 @@ window.Popup = new (class { } /** opens the popup * @param evt the current event - * @param dataContextIfCurrentDataIsUndefined use this dataContext if this.currentData() is undefined + * @param options options (dataContextIfCurrentDataIsUndefined use this dataContext if this.currentData() is undefined) */ - return function(evt, dataContextIfCurrentDataIsUndefined) { + return function(evt, options) { // If a popup is already opened, clicking again on the opener element // should close it -- and interrupt the current `open` function. if (self.isOpen()) { @@ -71,7 +71,7 @@ window.Popup = new (class { title: self._getTitle(popupName), depth: self._stack.length, offset: self._getOffset(openerElement), - dataContext: (this && this.currentData && this.currentData()) || dataContextIfCurrentDataIsUndefined || this, + dataContext: (this && this.currentData && this.currentData()) || (options && options.dataContextIfCurrentDataIsUndefined) || this, }); // If there are no popup currently opened we use the Blaze API to render From f90fb284838639845ab1ba14b0acbdfbb5e7d99c Mon Sep 17 00:00:00 2001 From: Martin Filser Date: Thu, 28 Oct 2021 11:39:26 +0200 Subject: [PATCH 2/4] Card archive closes now the popup after confirmation --- client/components/cards/cardDetails.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/components/cards/cardDetails.js b/client/components/cards/cardDetails.js index 66f66c3eb..06bc1ee2c 100644 --- a/client/components/cards/cardDetails.js +++ b/client/components/cards/cardDetails.js @@ -692,7 +692,7 @@ Template.cardDetailsActionsPopup.events({ this.move(this.boardId, this.swimlaneId, this.listId, maxOrder + 1); }, 'click .js-archive': Popup.afterConfirm('cardArchive', function () { - Popup.back(); + Popup.close(); this.archive(); Utils.goBoardId(this.boardId); }), From c7ab0403a6dec48145a4a4533804e506c05d19ae Mon Sep 17 00:00:00 2001 From: Martin Filser Date: Thu, 28 Oct 2021 11:40:09 +0200 Subject: [PATCH 3/4] Card watching closes now the popup after confirmation --- client/components/cards/cardDetails.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/components/cards/cardDetails.js b/client/components/cards/cardDetails.js index 06bc1ee2c..fb8e9c8aa 100644 --- a/client/components/cards/cardDetails.js +++ b/client/components/cards/cardDetails.js @@ -701,7 +701,7 @@ Template.cardDetailsActionsPopup.events({ const currentCard = this; const level = currentCard.findWatcher(Meteor.userId()) ? null : 'watching'; Meteor.call('watch', 'card', currentCard._id, level, (err, ret) => { - if (!err && ret) Popup.back(); + if (!err && ret) Popup.close(); }); }, }); From a686a18809e1515d04fc2865b6128acc049ff270 Mon Sep 17 00:00:00 2001 From: Martin Filser Date: Wed, 27 Oct 2021 17:28:15 +0200 Subject: [PATCH 4/4] Fix: Card color setting reloaded the board (hotfix) - There is another issue why the board get's reloaded again. If i comment out the whole events() block so the card color is not saved, the boards get reloaded too ... --- client/components/cards/cardDetails.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/components/cards/cardDetails.js b/client/components/cards/cardDetails.js index fb8e9c8aa..a818b6351 100644 --- a/client/components/cards/cardDetails.js +++ b/client/components/cards/cardDetails.js @@ -1007,7 +1007,7 @@ BlazeComponent.extendComponent({ }, 'click .js-submit'() { this.currentCard.setColor(this.currentColor.get()); - Popup.back(); + Popup.close(); }, 'click .js-remove-color'() { this.currentCard.setColor(null);