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

@ -34,7 +34,7 @@ BlazeComponent.extendComponent({
Utils.goBoardId(board._id); Utils.goBoardId(board._id);
}, },
'click .js-delete-board': Popup.afterConfirm('boardDelete', function() { 'click .js-delete-board': Popup.afterConfirm('boardDelete', function() {
Popup.close(); Popup.back();
const isSandstorm = const isSandstorm =
Meteor.settings && Meteor.settings &&
Meteor.settings.public && Meteor.settings.public &&

View file

@ -7,11 +7,11 @@ Template.boardMenuPopup.events({
'click .js-rename-board': Popup.open('boardChangeTitle'), 'click .js-rename-board': Popup.open('boardChangeTitle'),
'click .js-custom-fields'() { 'click .js-custom-fields'() {
Sidebar.setView('customFields'); Sidebar.setView('customFields');
Popup.close(); Popup.back();
}, },
'click .js-open-archives'() { 'click .js-open-archives'() {
Sidebar.setView('archives'); Sidebar.setView('archives');
Popup.close(); Popup.back();
}, },
'click .js-change-board-color': Popup.open('boardChangeColor'), 'click .js-change-board-color': Popup.open('boardChangeColor'),
'click .js-change-language': Popup.open('changeLanguage'), 'click .js-change-language': Popup.open('changeLanguage'),
@ -24,7 +24,7 @@ Template.boardMenuPopup.events({
}), }),
'click .js-delete-board': Popup.afterConfirm('deleteBoard', function() { 'click .js-delete-board': Popup.afterConfirm('deleteBoard', function() {
const currentBoard = Boards.findOne(Session.get('currentBoard')); const currentBoard = Boards.findOne(Session.get('currentBoard'));
Popup.close(); Popup.back();
Boards.remove(currentBoard._id); Boards.remove(currentBoard._id);
FlowRouter.go('home'); FlowRouter.go('home');
}), }),
@ -47,7 +47,7 @@ Template.boardChangeTitlePopup.events({
if (newTitle) { if (newTitle) {
this.rename(newTitle); this.rename(newTitle);
this.setDescription(newDesc); this.setDescription(newDesc);
Popup.close(); Popup.back();
} }
event.preventDefault(); event.preventDefault();
}, },
@ -173,15 +173,15 @@ Template.boardHeaderBar.helpers({
Template.boardChangeViewPopup.events({ Template.boardChangeViewPopup.events({
'click .js-open-lists-view'() { 'click .js-open-lists-view'() {
Utils.setBoardView('board-view-lists'); Utils.setBoardView('board-view-lists');
Popup.close(); Popup.back();
}, },
'click .js-open-swimlanes-view'() { 'click .js-open-swimlanes-view'() {
Utils.setBoardView('board-view-swimlanes'); Utils.setBoardView('board-view-swimlanes');
Popup.close(); Popup.back();
}, },
'click .js-open-cal-view'() { 'click .js-open-cal-view'() {
Utils.setBoardView('board-view-cal'); Utils.setBoardView('board-view-cal');
Popup.close(); Popup.back();
}, },
}); });
@ -327,7 +327,7 @@ BlazeComponent.extendComponent({
const currentBoard = Boards.findOne(Session.get('currentBoard')); const currentBoard = Boards.findOne(Session.get('currentBoard'));
const visibility = this.currentData(); const visibility = this.currentData();
currentBoard.setVisibility(visibility); currentBoard.setVisibility(visibility);
Popup.close(); Popup.back();
}, },
events() { events() {
@ -360,7 +360,7 @@ BlazeComponent.extendComponent({
Session.get('currentBoard'), Session.get('currentBoard'),
level, level,
(err, ret) => { (err, ret) => {
if (!err && ret) Popup.close(); if (!err && ret) Popup.back();
}, },
); );
}, },
@ -432,7 +432,7 @@ BlazeComponent.extendComponent({
const direction = down ? -1 : 1; const direction = down ? -1 : 1;
this.setSortBy([sortby, direction]); this.setSortBy([sortby, direction]);
if (Utils.isMiniScreen) { if (Utils.isMiniScreen) {
Popup.close(); Popup.back();
} }
}, },
}, },
@ -451,7 +451,7 @@ BlazeComponent.extendComponent({
}; };
Session.set('sortBy', sortBy); Session.set('sortBy', sortBy);
sortCardsBy.set(TAPi18n.__('due-date')); sortCardsBy.set(TAPi18n.__('due-date'));
Popup.close(); Popup.back();
}, },
'click .js-sort-title'() { 'click .js-sort-title'() {
const sortBy = { const sortBy = {
@ -459,7 +459,7 @@ BlazeComponent.extendComponent({
}; };
Session.set('sortBy', sortBy); Session.set('sortBy', sortBy);
sortCardsBy.set(TAPi18n.__('title')); sortCardsBy.set(TAPi18n.__('title'));
Popup.close(); Popup.back();
}, },
'click .js-sort-created-asc'() { 'click .js-sort-created-asc'() {
const sortBy = { const sortBy = {
@ -467,7 +467,7 @@ BlazeComponent.extendComponent({
}; };
Session.set('sortBy', sortBy); Session.set('sortBy', sortBy);
sortCardsBy.set(TAPi18n.__('date-created-newest-first')); sortCardsBy.set(TAPi18n.__('date-created-newest-first'));
Popup.close(); Popup.back();
}, },
'click .js-sort-created-desc'() { 'click .js-sort-created-desc'() {
const sortBy = { const sortBy = {
@ -475,7 +475,7 @@ BlazeComponent.extendComponent({
}; };
Session.set('sortBy', sortBy); Session.set('sortBy', sortBy);
sortCardsBy.set(TAPi18n.__('date-created-oldest-first')); sortCardsBy.set(TAPi18n.__('date-created-oldest-first'));
Popup.close(); Popup.back();
}, },
}, },
]; ];

View file

@ -106,7 +106,7 @@ BlazeComponent.extendComponent({
if (!Number.isNaN(sort)) { if (!Number.isNaN(sort)) {
let card = this.data(); let card = this.data();
card.move(card.boardId, card.swimlaneId, card.listId, sort); card.move(card.boardId, card.swimlaneId, card.listId, sort);
Popup.close(); Popup.back();
} }
}, },
} }

View file

@ -496,7 +496,7 @@ BlazeComponent.extendComponent({
evt.preventDefault(); evt.preventDefault();
const linkedId = $('.js-select-cards option:selected').val(); const linkedId = $('.js-select-cards option:selected').val();
if (!linkedId) { if (!linkedId) {
Popup.close(); Popup.back();
return; return;
} }
const _id = Cards.insert({ const _id = Cards.insert({
@ -511,7 +511,7 @@ BlazeComponent.extendComponent({
linkedId, linkedId,
}); });
Filter.addException(_id); Filter.addException(_id);
Popup.close(); Popup.back();
}, },
'click .js-link-board'(evt) { 'click .js-link-board'(evt) {
//LINK BOARD //LINK BOARD
@ -522,7 +522,7 @@ BlazeComponent.extendComponent({
!impBoardId || !impBoardId ||
Cards.findOne({ linkedId: impBoardId, archived: false }) Cards.findOne({ linkedId: impBoardId, archived: false })
) { ) {
Popup.close(); Popup.back();
return; return;
} }
const _id = Cards.insert({ const _id = Cards.insert({
@ -537,7 +537,7 @@ BlazeComponent.extendComponent({
linkedId: impBoardId, linkedId: impBoardId,
}); });
Filter.addException(_id); Filter.addException(_id);
Popup.close(); Popup.back();
}, },
}, },
]; ];
@ -584,7 +584,7 @@ BlazeComponent.extendComponent({
}); });
} }
if (!board) { if (!board) {
Popup.close(); Popup.back();
return; return;
} }
const boardId = board._id; const boardId = board._id;
@ -711,7 +711,7 @@ BlazeComponent.extendComponent({
}, },
); );
} }
Popup.close(); Popup.back();
}, },
}, },
]; ];

View file

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

View file

@ -38,12 +38,12 @@ BlazeComponent.extendComponent({
{ {
'click .js-due-cards-view-me'() { 'click .js-due-cards-view-me'() {
Utils.setDueCardsView('me'); Utils.setDueCardsView('me');
Popup.close(); Popup.back();
}, },
'click .js-due-cards-view-all'() { 'click .js-due-cards-view-all'() {
Utils.setDueCardsView('all'); Utils.setDueCardsView('all');
Popup.close(); Popup.back();
}, },
}, },
]; ];

View file

@ -232,7 +232,7 @@ BlazeComponent.extendComponent({
}, },
'click .js-submit'() { 'click .js-submit'() {
this.colorButtonValue.set(this.currentColor.get()); this.colorButtonValue.set(this.currentColor.get());
Popup.close(); Popup.back();
}, },
}, },
]; ];

View file

@ -116,6 +116,6 @@ Template.boardCardTitlePopup.events({
.trim(); .trim();
Popup.getOpenerComponent().setNameFilter(title); Popup.getOpenerComponent().setNameFilter(title);
event.preventDefault(); event.preventDefault();
Popup.close(); Popup.back();
}, },
}); });

View file

@ -562,7 +562,7 @@ Template.editOrgPopup.events({
); );
} }
Popup.close(); Popup.back();
}, },
}); });
@ -606,7 +606,7 @@ Template.editTeamPopup.events({
); );
} }
Popup.close(); Popup.back();
}, },
}); });
@ -721,7 +721,7 @@ Template.editUserPopup.events({
} else { } else {
usernameMessageElement.hide(); usernameMessageElement.hide();
emailMessageElement.hide(); emailMessageElement.hide();
Popup.close(); Popup.back();
} }
}, },
); );
@ -735,7 +735,7 @@ Template.editUserPopup.events({
} }
} else { } else {
usernameMessageElement.hide(); usernameMessageElement.hide();
Popup.close(); Popup.back();
} }
}); });
} else if (isChangeEmail) { } else if (isChangeEmail) {
@ -752,11 +752,11 @@ Template.editUserPopup.events({
} }
} else { } else {
emailMessageElement.hide(); emailMessageElement.hide();
Popup.close(); Popup.back();
} }
}, },
); );
} else Popup.close(); } else Popup.back();
}, },
'click #addUserOrg'(event) { 'click #addUserOrg'(event) {
event.preventDefault(); event.preventDefault();
@ -891,7 +891,7 @@ Template.newOrgPopup.events({
orgWebsite, orgWebsite,
orgIsActive, orgIsActive,
); );
Popup.close(); Popup.back();
}, },
}); });
@ -917,7 +917,7 @@ Template.newTeamPopup.events({
teamWebsite, teamWebsite,
teamIsActive, teamIsActive,
); );
Popup.close(); Popup.back();
}, },
}); });
@ -990,11 +990,11 @@ Template.newUserPopup.events({
} else { } else {
usernameMessageElement.hide(); usernameMessageElement.hide();
emailMessageElement.hide(); emailMessageElement.hide();
Popup.close(); Popup.back();
} }
}, },
); );
Popup.close(); Popup.back();
}, },
'click #addUserOrgNewUser'(event) { 'click #addUserOrgNewUser'(event) {
event.preventDefault(); event.preventDefault();
@ -1048,7 +1048,7 @@ Template.settingsOrgPopup.events({
return; return;
} }
Org.remove(this.orgId); Org.remove(this.orgId);
Popup.close(); Popup.back();
} }
}); });
@ -1066,7 +1066,7 @@ Template.settingsTeamPopup.events({
return; return;
} }
Team.remove(this.teamId); Team.remove(this.teamId);
Popup.close(); Popup.back();
} }
}); });
@ -1099,7 +1099,7 @@ Template.settingsUserPopup.events({
// //
// //
*/ */
Popup.close(); Popup.back();
}, },
}); });

View file

@ -188,15 +188,15 @@ Template.boardMenuPopup.events({
'click .js-rename-board': Popup.open('boardChangeTitle'), 'click .js-rename-board': Popup.open('boardChangeTitle'),
'click .js-open-rules-view'() { 'click .js-open-rules-view'() {
Modal.openWide('rulesMain'); Modal.openWide('rulesMain');
Popup.close(); Popup.back();
}, },
'click .js-custom-fields'() { 'click .js-custom-fields'() {
Sidebar.setView('customFields'); Sidebar.setView('customFields');
Popup.close(); Popup.back();
}, },
'click .js-open-archives'() { 'click .js-open-archives'() {
Sidebar.setView('archives'); Sidebar.setView('archives');
Popup.close(); Popup.back();
}, },
'click .js-change-board-color': Popup.open('boardChangeColor'), 'click .js-change-board-color': Popup.open('boardChangeColor'),
'click .js-change-language': Popup.open('changeLanguage'), 'click .js-change-language': Popup.open('changeLanguage'),
@ -209,7 +209,7 @@ Template.boardMenuPopup.events({
}), }),
'click .js-delete-board': Popup.afterConfirm('deleteBoard', function() { 'click .js-delete-board': Popup.afterConfirm('deleteBoard', function() {
const currentBoard = Boards.findOne(Session.get('currentBoard')); const currentBoard = Boards.findOne(Session.get('currentBoard'));
Popup.close(); Popup.back();
Boards.remove(currentBoard._id); Boards.remove(currentBoard._id);
FlowRouter.go('home'); FlowRouter.go('home');
}), }),
@ -252,7 +252,7 @@ Template.boardMenuPopup.helpers({
Template.memberPopup.events({ Template.memberPopup.events({
'click .js-filter-member'() { 'click .js-filter-member'() {
Filter.members.toggle(this.userId); Filter.members.toggle(this.userId);
Popup.close(); Popup.back();
}, },
'click .js-change-role': Popup.open('changePermissions'), 'click .js-change-role': Popup.open('changePermissions'),
'click .js-remove-member': Popup.afterConfirm('removeMember', function() { 'click .js-remove-member': Popup.afterConfirm('removeMember', function() {
@ -266,12 +266,12 @@ Template.memberPopup.events({
card.unassignAssignee(memberId); card.unassignAssignee(memberId);
}); });
Boards.findOne(boardId).removeMember(memberId); Boards.findOne(boardId).removeMember(memberId);
Popup.close(); Popup.back();
}), }),
'click .js-leave-member': Popup.afterConfirm('leaveBoard', () => { 'click .js-leave-member': Popup.afterConfirm('leaveBoard', () => {
const boardId = Session.get('currentBoard'); const boardId = Session.get('currentBoard');
Meteor.call('quitBoard', boardId, () => { Meteor.call('quitBoard', boardId, () => {
Popup.close(); Popup.back();
FlowRouter.go('home'); FlowRouter.go('home');
}); });
}), }),
@ -460,7 +460,7 @@ BlazeComponent.extendComponent({
activities: ['all'], activities: ['all'],
}); });
} }
Popup.close(); Popup.back();
}, },
}, },
]; ];
@ -1229,7 +1229,7 @@ BlazeComponent.extendComponent({
self.setLoading(false); self.setLoading(false);
if (err) self.setError(err.error); if (err) self.setError(err.error);
else if (ret.email) self.setError('email-sent'); else if (ret.email) self.setError('email-sent');
else Popup.close(); else Popup.back();
}); });
}, },
@ -1316,7 +1316,7 @@ BlazeComponent.extendComponent({
} }
} }
Popup.close(); Popup.back();
}, },
}, },
]; ];
@ -1380,10 +1380,10 @@ BlazeComponent.extendComponent({
Meteor.call('setBoardOrgs', boardOrganizations, currentBoard._id); Meteor.call('setBoardOrgs', boardOrganizations, currentBoard._id);
Popup.close(); Popup.back();
}, },
'click #cancelLeaveBoardBtn'(){ 'click #cancelLeaveBoardBtn'(){
Popup.close(); Popup.back();
}, },
}, },
]; ];
@ -1490,7 +1490,7 @@ BlazeComponent.extendComponent({
} }
} }
Popup.close(); Popup.back();
}, },
}, },
]; ];
@ -1581,10 +1581,10 @@ BlazeComponent.extendComponent({
Meteor.call('setBoardTeams', boardTeams, members, currentBoard._id); Meteor.call('setBoardTeams', boardTeams, members, currentBoard._id);
Popup.close(); Popup.back();
}, },
'click #cancelLeaveBoardTeamBtn'(){ 'click #cancelLeaveBoardTeamBtn'(){
Popup.close(); Popup.back();
}, },
}, },
]; ];

View file

@ -94,13 +94,13 @@ BlazeComponent.extendComponent({
'click .js-delete-card': Popup.afterConfirm('cardDelete', function() { 'click .js-delete-card': Popup.afterConfirm('cardDelete', function() {
const cardId = this._id; const cardId = this._id;
Cards.remove(cardId); Cards.remove(cardId);
Popup.close(); Popup.back();
}), }),
'click .js-delete-all-cards': Popup.afterConfirm('cardDelete', () => { 'click .js-delete-all-cards': Popup.afterConfirm('cardDelete', () => {
this.archivedCards().forEach(card => { this.archivedCards().forEach(card => {
Cards.remove(card._id); Cards.remove(card._id);
}); });
Popup.close(); Popup.back();
}), }),
'click .js-restore-list'() { 'click .js-restore-list'() {
@ -115,13 +115,13 @@ BlazeComponent.extendComponent({
'click .js-delete-list': Popup.afterConfirm('listDelete', function() { 'click .js-delete-list': Popup.afterConfirm('listDelete', function() {
this.remove(); this.remove();
Popup.close(); Popup.back();
}), }),
'click .js-delete-all-lists': Popup.afterConfirm('listDelete', () => { 'click .js-delete-all-lists': Popup.afterConfirm('listDelete', () => {
this.archivedLists().forEach(list => { this.archivedLists().forEach(list => {
list.remove(); list.remove();
}); });
Popup.close(); Popup.back();
}), }),
'click .js-restore-swimlane'() { 'click .js-restore-swimlane'() {
@ -138,7 +138,7 @@ BlazeComponent.extendComponent({
'swimlaneDelete', 'swimlaneDelete',
function() { function() {
this.remove(); this.remove();
Popup.close(); Popup.back();
}, },
), ),
'click .js-delete-all-swimlanes': Popup.afterConfirm( 'click .js-delete-all-swimlanes': Popup.afterConfirm(
@ -147,7 +147,7 @@ BlazeComponent.extendComponent({
this.archivedSwimlanes().forEach(swimlane => { this.archivedSwimlanes().forEach(swimlane => {
swimlane.remove(); swimlane.remove();
}); });
Popup.close(); Popup.back();
}, },
), ),
}, },

View file

@ -283,7 +283,7 @@ const CreateCustomFieldPopup = BlazeComponent.extendComponent({
} else { } else {
CustomFields.remove(customField._id); CustomFields.remove(customField._id);
} }
Popup.close(); Popup.back();
}, },
), ),
}, },
@ -302,6 +302,6 @@ CreateCustomFieldPopup.register('createCustomFieldPopup');
'submit'(evt) { 'submit'(evt) {
const customFieldId = this._id; const customFieldId = this._id;
CustomFields.remove(customFieldId); CustomFields.remove(customFieldId);
Popup.close(); Popup.back();
} }
});*/ });*/

View file

@ -171,22 +171,22 @@ Template.multiselectionSidebar.helpers({
Template.disambiguateMultiLabelPopup.events({ Template.disambiguateMultiLabelPopup.events({
'click .js-remove-label'() { 'click .js-remove-label'() {
mutateSelectedCards('removeLabel', this._id); mutateSelectedCards('removeLabel', this._id);
Popup.close(); Popup.back();
}, },
'click .js-add-label'() { 'click .js-add-label'() {
mutateSelectedCards('addLabel', this._id); mutateSelectedCards('addLabel', this._id);
Popup.close(); Popup.back();
}, },
}); });
Template.disambiguateMultiMemberPopup.events({ Template.disambiguateMultiMemberPopup.events({
'click .js-unassign-member'() { 'click .js-unassign-member'() {
mutateSelectedCards('assignMember', this._id); mutateSelectedCards('assignMember', this._id);
Popup.close(); Popup.back();
}, },
'click .js-assign-member'() { 'click .js-assign-member'() {
mutateSelectedCards('unassignMember', this._id); mutateSelectedCards('unassignMember', this._id);
Popup.close(); Popup.back();
}, },
}); });

View file

@ -39,7 +39,7 @@ Template.swimlaneActionPopup.events({
'click .js-close-swimlane'(event) { 'click .js-close-swimlane'(event) {
event.preventDefault(); event.preventDefault();
this.archive(); this.archive();
Popup.close(); Popup.back();
}, },
'click .js-move-swimlane': Popup.open('moveSwimlane'), 'click .js-move-swimlane': Popup.open('moveSwimlane'),
'click .js-copy-swimlane': Popup.open('copySwimlane'), 'click .js-copy-swimlane': Popup.open('copySwimlane'),
@ -88,7 +88,7 @@ BlazeComponent.extendComponent({
// XXX ideally, we should move the popup to the newly // XXX ideally, we should move the popup to the newly
// created swimlane so a user can add more than one swimlane // created swimlane so a user can add more than one swimlane
// with a minimum of interactions // with a minimum of interactions
Popup.close(); Popup.back();
}, },
'click .js-swimlane-template': Popup.open('searchElement'), 'click .js-swimlane-template': Popup.open('searchElement'),
}, },
@ -118,11 +118,11 @@ BlazeComponent.extendComponent({
}, },
'click .js-submit'() { 'click .js-submit'() {
this.currentSwimlane.setColor(this.currentColor.get()); this.currentSwimlane.setColor(this.currentColor.get());
Popup.close(); Popup.back();
}, },
'click .js-remove-color'() { 'click .js-remove-color'() {
this.currentSwimlane.setColor(null); this.currentSwimlane.setColor(null);
Popup.close(); Popup.back();
}, },
}, },
]; ];

View file

@ -327,7 +327,7 @@ class MoveSwimlaneComponent extends BlazeComponent {
boardId = bSelect.options[bSelect.selectedIndex].value; boardId = bSelect.options[bSelect.selectedIndex].value;
Meteor.call(this.serverMethod, this.currentSwimlane._id, boardId); Meteor.call(this.serverMethod, this.currentSwimlane._id, boardId);
} }
Popup.close(); Popup.back();
}, },
}, },
]; ];

View file

@ -290,7 +290,7 @@ Template.cardMemberPopup.helpers({
Template.cardMemberPopup.events({ Template.cardMemberPopup.events({
'click .js-remove-member'() { 'click .js-remove-member'() {
Cards.findOne(this.cardId).unassignMember(this.userId); Cards.findOne(this.cardId).unassignMember(this.userId);
Popup.close(); Popup.back();
}, },
'click .js-edit-profile': Popup.open('editProfile'), 'click .js-edit-profile': Popup.open('editProfile'),
}); });

View file

@ -34,10 +34,10 @@ Template.memberMenuPopup.helpers({
Template.memberMenuPopup.events({ Template.memberMenuPopup.events({
'click .js-my-cards'() { 'click .js-my-cards'() {
Popup.close(); Popup.back();
}, },
'click .js-due-cards'() { 'click .js-due-cards'() {
Popup.close(); Popup.back();
}, },
'click .js-open-archived-board'() { 'click .js-open-archived-board'() {
Modal.open('archivedBoards'); Modal.open('archivedBoards');
@ -53,7 +53,7 @@ Template.memberMenuPopup.events({
AccountsTemplates.logout(); AccountsTemplates.logout();
}, },
'click .js-go-setting'() { 'click .js-go-setting'() {
Popup.close(); Popup.back();
}, },
}); });
@ -155,7 +155,7 @@ Template.editProfilePopup.events({
} else Popup.back(); } else Popup.back();
}, },
'click #deleteButton': Popup.afterConfirm('userDelete', function() { 'click #deleteButton': Popup.afterConfirm('userDelete', function() {
Popup.close(); Popup.back();
Users.remove(Meteor.userId()); Users.remove(Meteor.userId());
AccountsTemplates.logout(); AccountsTemplates.logout();
}), }),