Use Popup.back() instead of Popup.close() to get no conflicts if a Popup is opened as "Sub Popup"

- .back() is also .close() if there is no "popup layer" left
This commit is contained in:
Martin Filser 2021-10-21 10:35:16 +02:00
parent a59dfa8fc0
commit b9250e4be4
17 changed files with 82 additions and 82 deletions

View file

@ -145,19 +145,19 @@ Template.listActionPopup.events({
'click .js-select-cards'() {
const cardIds = this.allCards().map(card => card._id);
MultiSelection.add(cardIds);
Popup.close();
Popup.back();
},
'click .js-toggle-watch-list'() {
const currentList = this;
const level = currentList.findWatcher(Meteor.userId()) ? null : 'watching';
Meteor.call('watch', 'list', currentList._id, level, (err, ret) => {
if (!err && ret) Popup.close();
if (!err && ret) Popup.back();
});
},
'click .js-close-list'(event) {
event.preventDefault();
this.archive();
Popup.close();
Popup.back();
},
'click .js-set-wip-limit': Popup.open('setWipLimit'),
'click .js-more': Popup.open('listMore'),
@ -233,7 +233,7 @@ BlazeComponent.extendComponent({
Template.listMorePopup.events({
'click .js-delete': Popup.afterConfirm('listDelete', function() {
Popup.close();
Popup.back();
// TODO how can we avoid the fetch call?
const allCards = this.allCards().fetch();
const allCardIds = _.pluck(allCards, '_id');
@ -299,11 +299,11 @@ BlazeComponent.extendComponent({
},
'click .js-submit'() {
this.currentList.setColor(this.currentColor.get());
Popup.close();
Popup.back();
},
'click .js-remove-color'() {
this.currentList.setColor(null);
Popup.close();
Popup.back();
},
},
];