From a59dfa8fc0d1280c35375c33f6d10a736acbf4b8 Mon Sep 17 00:00:00 2001 From: Martin Filser Date: Thu, 21 Oct 2021 10:12:55 +0200 Subject: [PATCH 1/9] Card Details Popup, every "Sub-Popup" must use .back() instead of .close() - .close() closes the popup. Until now it was ok, but as the Card Details are opened in a popup too, .back() must be used to get the same behaviour back - .back() is also .close() if there is no "popup layer" left --- client/components/activities/activities.js | 2 +- client/components/cards/attachments.js | 8 +- client/components/cards/cardDetails.js | 112 ++++++++------------- client/components/cards/cardTime.js | 4 +- client/lib/exportHTML.js | 2 +- 5 files changed, 51 insertions(+), 77 deletions(-) diff --git a/client/components/activities/activities.js b/client/components/activities/activities.js index de12987c8..6bb7f4f8e 100644 --- a/client/components/activities/activities.js +++ b/client/components/activities/activities.js @@ -269,7 +269,7 @@ Template.addReactionPopup.events({ const cardComment = CardComments.findOne({_id: commentId}); cardComment.toggleReaction(codepoint); } - Popup.close(); + Popup.back(); }, }) diff --git a/client/components/cards/attachments.js b/client/components/cards/attachments.js index bd668a8e9..bbc00c6f3 100644 --- a/client/components/cards/attachments.js +++ b/client/components/cards/attachments.js @@ -4,7 +4,7 @@ Template.attachmentsGalery.events({ 'attachmentDelete', function() { Attachments.remove(this._id); - Popup.close(); + Popup.back(); }, ), // If we let this event bubble, FlowRouter will handle it and empty the page @@ -53,7 +53,7 @@ Template.attachmentsGalery.helpers({ Template.previewAttachedImagePopup.events({ 'click .js-large-image-clicked'() { - Popup.close(); + Popup.back(); }, }); @@ -65,7 +65,7 @@ Template.cardAttachmentsPopup.events({ if (attachment && attachment._id && attachment.isImage()) { card.setCover(attachment._id); } - Popup.close(); + Popup.back(); }); }; @@ -174,7 +174,7 @@ Template.previewClipboardImagePopup.events({ pastedResults = null; $(document.body).pasteImageReader(() => {}); - Popup.close(); + Popup.back(); } }, }); diff --git a/client/components/cards/cardDetails.js b/client/components/cards/cardDetails.js index f33960eba..951e26ee8 100644 --- a/client/components/cards/cardDetails.js +++ b/client/components/cards/cardDetails.js @@ -691,7 +691,7 @@ Template.cardDetailsActionsPopup.events({ this.move(this.boardId, this.swimlaneId, this.listId, maxOrder + 1); }, 'click .js-archive': Popup.afterConfirm('cardArchive', function () { - Popup.close(); + Popup.back(); this.archive(); Utils.goBoardId(this.boardId); }), @@ -700,7 +700,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.close(); + if (!err && ret) Popup.back(); }); }, }); @@ -819,7 +819,7 @@ Template.moveCardPopup.events({ const slSelect = $('.js-select-swimlanes')[0]; const swimlaneId = slSelect.options[slSelect.selectedIndex].value; card.move(boardId, swimlaneId, listId, 0); - Popup.close(); + Popup.back(); }, }); BlazeComponent.extendComponent({ @@ -887,7 +887,7 @@ Template.copyCardPopup.events({ // See https://github.com/wekan/wekan/issues/80 Filter.addException(_id); - Popup.close(); + Popup.back(); } }, }); @@ -914,7 +914,7 @@ Template.convertChecklistItemToCardPopup.events({ }); Filter.addException(_id); - Popup.close(); + Popup.back(); } }, @@ -970,7 +970,7 @@ Template.copyChecklistToManyCardsPopup.events({ cmt.copy(_id); }); } - Popup.close(); + Popup.back(); } }, }); @@ -1000,11 +1000,11 @@ BlazeComponent.extendComponent({ }, 'click .js-submit'() { this.currentCard.setColor(this.currentColor.get()); - Popup.close(); + Popup.back(); }, 'click .js-remove-color'() { this.currentCard.setColor(null); - Popup.close(); + Popup.back(); }, }, ]; @@ -1106,7 +1106,7 @@ BlazeComponent.extendComponent({ } }, 'click .js-delete': Popup.afterConfirm('cardDelete', function () { - Popup.close(); + Popup.back(); // verify that there are no linked cards if (Cards.find({ linkedId: this._id }).count() === 0) { Cards.remove(this._id); @@ -1173,12 +1173,12 @@ BlazeComponent.extendComponent({ if (endString) { this.currentCard.setVoteEnd(endString); } - Popup.close(); + Popup.back(); }, 'click .js-remove-vote': Popup.afterConfirm('deleteVote', () => { event.preventDefault(); this.currentCard.unsetVote(); - Popup.close(); + Popup.back(); }), 'click a.js-toggle-vote-public'(event) { event.preventDefault(); @@ -1218,7 +1218,7 @@ BlazeComponent.extendComponent({ // if active vote - store it if (this.currentData().getVoteQuestion()) { this._storeDate(newDate.toDate()); - Popup.close(); + Popup.back(); } else { this.currentData().vote = { end: newDate.toDate() }; // set vote end temp Popup.back(); @@ -1252,86 +1252,77 @@ BlazeComponent.extendComponent({ // if active poker - store it if (this.currentData().getPokerQuestion()) { this._storeDate(usaDate.toDate()); - Popup.close(); } else { this.currentData().poker = { end: usaDate.toDate() }; // set poker end temp - Popup.back(); } + Popup.back(); } else if (euroAmDate.isValid()) { // if active poker - store it if (this.currentData().getPokerQuestion()) { this._storeDate(euroAmDate.toDate()); - Popup.close(); } else { this.currentData().poker = { end: euroAmDate.toDate() }; // set poker end temp - Popup.back(); } + Popup.back(); } else if (euro24hDate.isValid()) { // if active poker - store it if (this.currentData().getPokerQuestion()) { this._storeDate(euro24hDate.toDate()); this.card.setPokerEnd(euro24hDate.toDate()); - Popup.close(); } else { this.currentData().poker = { end: euro24hDate.toDate() }; // set poker end temp - Popup.back(); } + Popup.back(); } else if (eurodotDate.isValid()) { // if active poker - store it if (this.currentData().getPokerQuestion()) { this._storeDate(eurodotDate.toDate()); this.card.setPokerEnd(eurodotDate.toDate()); - Popup.close(); } else { this.currentData().poker = { end: eurodotDate.toDate() }; // set poker end temp - Popup.back(); } + Popup.back(); } else if (minusDate.isValid()) { // if active poker - store it if (this.currentData().getPokerQuestion()) { this._storeDate(minusDate.toDate()); this.card.setPokerEnd(minusDate.toDate()); - Popup.close(); } else { this.currentData().poker = { end: minusDate.toDate() }; // set poker end temp - Popup.back(); } + Popup.back(); } else if (slashDate.isValid()) { // if active poker - store it if (this.currentData().getPokerQuestion()) { this._storeDate(slashDate.toDate()); this.card.setPokerEnd(slashDate.toDate()); - Popup.close(); } else { this.currentData().poker = { end: slashDate.toDate() }; // set poker end temp - Popup.back(); } + Popup.back(); } else if (dotDate.isValid()) { // if active poker - store it if (this.currentData().getPokerQuestion()) { this._storeDate(dotDate.toDate()); this.card.setPokerEnd(dotDate.toDate()); - Popup.close(); } else { this.currentData().poker = { end: dotDate.toDate() }; // set poker end temp - Popup.back(); } + Popup.back(); } else if (brezhonegDate.isValid()) { // if active poker - store it if (this.currentData().getPokerQuestion()) { this._storeDate(brezhonegDate.toDate()); this.card.setPokerEnd(brezhonegDate.toDate()); - Popup.close(); } else { this.currentData().poker = { end: brezhonegDate.toDate() }; // set poker end temp - Popup.back(); } + Popup.back(); } else if (hrvatskiDate.isValid()) { // if active poker - store it if (this.currentData().getPokerQuestion()) { this._storeDate(hrvatskiDate.toDate()); this.card.setPokerEnd(hrvatskiDate.toDate()); - Popup.close(); } else { this.currentData().poker = { end: hrvatskiDate.toDate() }; // set poker end temp Popup.back(); @@ -1341,41 +1332,37 @@ BlazeComponent.extendComponent({ if (this.currentData().getPokerQuestion()) { this._storeDate(latviaDate.toDate()); this.card.setPokerEnd(latviaDate.toDate()); - Popup.close(); } else { this.currentData().poker = { end: latviaDate.toDate() }; // set poker end temp - Popup.back(); } + Popup.back(); } else if (nederlandsDate.isValid()) { // if active poker - store it if (this.currentData().getPokerQuestion()) { this._storeDate(nederlandsDate.toDate()); this.card.setPokerEnd(nederlandsDate.toDate()); - Popup.close(); } else { this.currentData().poker = { end: nederlandsDate.toDate() }; // set poker end temp - Popup.back(); } + Popup.back(); } else if (greekDate.isValid()) { // if active poker - store it if (this.currentData().getPokerQuestion()) { this._storeDate(greekDate.toDate()); this.card.setPokerEnd(greekDate.toDate()); - Popup.close(); } else { this.currentData().poker = { end: greekDate.toDate() }; // set poker end temp - Popup.back(); } + Popup.back(); } else if (macedonianDate.isValid()) { // if active poker - store it if (this.currentData().getPokerQuestion()) { this._storeDate(macedonianDate.toDate()); this.card.setPokerEnd(macedonianDate.toDate()); - Popup.close(); } else { this.currentData().poker = { end: macedonianDate.toDate() }; // set poker end temp - Popup.back(); } + Popup.back(); } else { this.error.set('invalid-date'); evt.target.date.focus(); @@ -1384,7 +1371,7 @@ BlazeComponent.extendComponent({ 'click .js-delete-date'(evt) { evt.preventDefault(); this._deleteDate(); - Popup.close(); + Popup.back(); }, }, ]; @@ -1422,11 +1409,11 @@ BlazeComponent.extendComponent({ if (endString) { this.currentCard.setPokerEnd(endString); } - Popup.close(); + Popup.back(); }, 'click .js-remove-poker': Popup.afterConfirm('deletePoker', (event) => { this.currentCard.unsetPoker(); - Popup.close(); + Popup.back(); }), 'click a.js-toggle-poker-allow-non-members'(event) { event.preventDefault(); @@ -1489,7 +1476,7 @@ BlazeComponent.extendComponent({ // if active poker - store it if (this.currentData().getPokerQuestion()) { this._storeDate(newDate.toDate()); - Popup.close(); + Popup.back(); } else { this.currentData().poker = { end: newDate.toDate() }; // set poker end temp Popup.back(); @@ -1521,130 +1508,117 @@ BlazeComponent.extendComponent({ // if active poker - store it if (this.currentData().getPokerQuestion()) { this._storeDate(usaDate.toDate()); - Popup.close(); } else { this.currentData().poker = { end: usaDate.toDate() }; // set poker end temp - Popup.back(); } + Popup.back(); } else if (euroAmDate.isValid()) { // if active poker - store it if (this.currentData().getPokerQuestion()) { this._storeDate(euroAmDate.toDate()); - Popup.close(); } else { this.currentData().poker = { end: euroAmDate.toDate() }; // set poker end temp - Popup.back(); } + Popup.back(); } else if (euro24hDate.isValid()) { // if active poker - store it if (this.currentData().getPokerQuestion()) { this._storeDate(euro24hDate.toDate()); this.card.setPokerEnd(euro24hDate.toDate()); - Popup.close(); } else { this.currentData().poker = { end: euro24hDate.toDate() }; // set poker end temp - Popup.back(); } + Popup.back(); } else if (eurodotDate.isValid()) { // if active poker - store it if (this.currentData().getPokerQuestion()) { this._storeDate(eurodotDate.toDate()); this.card.setPokerEnd(eurodotDate.toDate()); - Popup.close(); } else { this.currentData().poker = { end: eurodotDate.toDate() }; // set poker end temp - Popup.back(); } + Popup.back(); } else if (minusDate.isValid()) { // if active poker - store it if (this.currentData().getPokerQuestion()) { this._storeDate(minusDate.toDate()); this.card.setPokerEnd(minusDate.toDate()); - Popup.close(); } else { this.currentData().poker = { end: minusDate.toDate() }; // set poker end temp - Popup.back(); } + Popup.back(); } else if (slashDate.isValid()) { // if active poker - store it if (this.currentData().getPokerQuestion()) { this._storeDate(slashDate.toDate()); this.card.setPokerEnd(slashDate.toDate()); - Popup.close(); } else { this.currentData().poker = { end: slashDate.toDate() }; // set poker end temp - Popup.back(); } + Popup.back(); } else if (dotDate.isValid()) { // if active poker - store it if (this.currentData().getPokerQuestion()) { this._storeDate(dotDate.toDate()); this.card.setPokerEnd(dotDate.toDate()); - Popup.close(); } else { this.currentData().poker = { end: dotDate.toDate() }; // set poker end temp - Popup.back(); } + Popup.back(); } else if (brezhonegDate.isValid()) { // if active poker - store it if (this.currentData().getPokerQuestion()) { this._storeDate(brezhonegDate.toDate()); this.card.setPokerEnd(brezhonegDate.toDate()); - Popup.close(); } else { this.currentData().poker = { end: brezhonegDate.toDate() }; // set poker end temp - Popup.back(); } + Popup.back(); } else if (hrvatskiDate.isValid()) { // if active poker - store it if (this.currentData().getPokerQuestion()) { this._storeDate(hrvatskiDate.toDate()); this.card.setPokerEnd(hrvatskiDate.toDate()); - Popup.close(); } else { this.currentData().poker = { end: hrvatskiDate.toDate() }; // set poker end temp - Popup.back(); } + Popup.back(); } else if (latviaDate.isValid()) { // if active poker - store it if (this.currentData().getPokerQuestion()) { this._storeDate(latviaDate.toDate()); this.card.setPokerEnd(latviaDate.toDate()); - Popup.close(); } else { this.currentData().poker = { end: latviaDate.toDate() }; // set poker end temp - Popup.back(); } + Popup.back(); } else if (nederlandsDate.isValid()) { // if active poker - store it if (this.currentData().getPokerQuestion()) { this._storeDate(nederlandsDate.toDate()); this.card.setPokerEnd(nederlandsDate.toDate()); - Popup.close(); } else { this.currentData().poker = { end: nederlandsDate.toDate() }; // set poker end temp - Popup.back(); } + Popup.back(); } else if (greekDate.isValid()) { // if active poker - store it if (this.currentData().getPokerQuestion()) { this._storeDate(greekDate.toDate()); this.card.setPokerEnd(greekDate.toDate()); - Popup.close(); } else { this.currentData().poker = { end: greekDate.toDate() }; // set poker end temp - Popup.back(); } + Popup.back(); } else if (macedonianDate.isValid()) { // if active poker - store it if (this.currentData().getPokerQuestion()) { this._storeDate(macedonianDate.toDate()); this.card.setPokerEnd(macedonianDate.toDate()); - Popup.close(); } else { this.currentData().poker = { end: macedonianDate.toDate() }; // set poker end temp - Popup.back(); } + Popup.back(); } else { // this.error.set('invalid-date); this.error.set('invalid-date' + ' ' + dateString); @@ -1654,7 +1628,7 @@ BlazeComponent.extendComponent({ 'click .js-delete-date'(evt) { evt.preventDefault(); this._deleteDate(); - Popup.close(); + Popup.back(); }, }, ]; @@ -1781,7 +1755,7 @@ Template.cardAssigneePopup.helpers({ Template.cardAssigneePopup.events({ 'click .js-remove-assignee'() { Cards.findOne(this.cardId).unassignAssignee(this.userId); - Popup.close(); + Popup.back(); }, 'click .js-edit-profile': Popup.open('editProfile'), }); diff --git a/client/components/cards/cardTime.js b/client/components/cards/cardTime.js index 20adbccfd..984f048e1 100644 --- a/client/components/cards/cardTime.js +++ b/client/components/cards/cardTime.js @@ -34,7 +34,7 @@ BlazeComponent.extendComponent({ } if (spentTime >= 0) { this.storeTime(spentTime, isOvertime); - Popup.close(); + Popup.back(); } else { this.error.set('invalid-time'); evt.target.time.focus(); @@ -43,7 +43,7 @@ BlazeComponent.extendComponent({ 'click .js-delete-time'(evt) { evt.preventDefault(); this.deleteTime(); - Popup.close(); + Popup.back(); }, 'click a.js-toggle-overtime': this.toggleOvertime, }, diff --git a/client/lib/exportHTML.js b/client/lib/exportHTML.js index 59a0612fc..1d00ccea5 100644 --- a/client/lib/exportHTML.js +++ b/client/lib/exportHTML.js @@ -187,7 +187,7 @@ window.ExportHtml = Popup => { const boardSlug = getBoardSlug(); await addJsonExportToZip(zip, boardSlug); - Popup.close(); + Popup.back(); closeSidebar(); cleanBoardHtml(); From b9250e4be499a623e3b23bd72f2ba1a6ad4f0a0b Mon Sep 17 00:00:00 2001 From: Martin Filser Date: Thu, 21 Oct 2021 10:35:16 +0200 Subject: [PATCH 2/9] 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 --- client/components/boards/boardArchive.js | 2 +- client/components/boards/boardHeader.js | 28 ++++++++--------- client/components/cards/minicard.js | 2 +- client/components/lists/listBody.js | 12 ++++---- client/components/lists/listHeader.js | 12 ++++---- client/components/main/dueCards.js | 4 +-- .../components/rules/actions/cardActions.js | 2 +- .../rules/triggers/boardTriggers.js | 2 +- client/components/settings/peopleBody.js | 26 ++++++++-------- client/components/sidebar/sidebar.js | 30 +++++++++---------- client/components/sidebar/sidebarArchives.js | 12 ++++---- .../components/sidebar/sidebarCustomFields.js | 4 +-- client/components/sidebar/sidebarFilters.js | 8 ++--- client/components/swimlanes/swimlaneHeader.js | 8 ++--- client/components/swimlanes/swimlanes.js | 2 +- client/components/users/userAvatar.js | 2 +- client/components/users/userHeader.js | 8 ++--- 17 files changed, 82 insertions(+), 82 deletions(-) diff --git a/client/components/boards/boardArchive.js b/client/components/boards/boardArchive.js index 49f024f8d..ca80a694b 100644 --- a/client/components/boards/boardArchive.js +++ b/client/components/boards/boardArchive.js @@ -34,7 +34,7 @@ BlazeComponent.extendComponent({ Utils.goBoardId(board._id); }, 'click .js-delete-board': Popup.afterConfirm('boardDelete', function() { - Popup.close(); + Popup.back(); const isSandstorm = Meteor.settings && Meteor.settings.public && diff --git a/client/components/boards/boardHeader.js b/client/components/boards/boardHeader.js index ef1a21fee..ed7d9490e 100644 --- a/client/components/boards/boardHeader.js +++ b/client/components/boards/boardHeader.js @@ -7,11 +7,11 @@ Template.boardMenuPopup.events({ 'click .js-rename-board': Popup.open('boardChangeTitle'), 'click .js-custom-fields'() { Sidebar.setView('customFields'); - Popup.close(); + Popup.back(); }, 'click .js-open-archives'() { Sidebar.setView('archives'); - Popup.close(); + Popup.back(); }, 'click .js-change-board-color': Popup.open('boardChangeColor'), 'click .js-change-language': Popup.open('changeLanguage'), @@ -24,7 +24,7 @@ Template.boardMenuPopup.events({ }), 'click .js-delete-board': Popup.afterConfirm('deleteBoard', function() { const currentBoard = Boards.findOne(Session.get('currentBoard')); - Popup.close(); + Popup.back(); Boards.remove(currentBoard._id); FlowRouter.go('home'); }), @@ -47,7 +47,7 @@ Template.boardChangeTitlePopup.events({ if (newTitle) { this.rename(newTitle); this.setDescription(newDesc); - Popup.close(); + Popup.back(); } event.preventDefault(); }, @@ -173,15 +173,15 @@ Template.boardHeaderBar.helpers({ Template.boardChangeViewPopup.events({ 'click .js-open-lists-view'() { Utils.setBoardView('board-view-lists'); - Popup.close(); + Popup.back(); }, 'click .js-open-swimlanes-view'() { Utils.setBoardView('board-view-swimlanes'); - Popup.close(); + Popup.back(); }, 'click .js-open-cal-view'() { Utils.setBoardView('board-view-cal'); - Popup.close(); + Popup.back(); }, }); @@ -327,7 +327,7 @@ BlazeComponent.extendComponent({ const currentBoard = Boards.findOne(Session.get('currentBoard')); const visibility = this.currentData(); currentBoard.setVisibility(visibility); - Popup.close(); + Popup.back(); }, events() { @@ -360,7 +360,7 @@ BlazeComponent.extendComponent({ Session.get('currentBoard'), level, (err, ret) => { - if (!err && ret) Popup.close(); + if (!err && ret) Popup.back(); }, ); }, @@ -432,7 +432,7 @@ BlazeComponent.extendComponent({ const direction = down ? -1 : 1; this.setSortBy([sortby, direction]); if (Utils.isMiniScreen) { - Popup.close(); + Popup.back(); } }, }, @@ -451,7 +451,7 @@ BlazeComponent.extendComponent({ }; Session.set('sortBy', sortBy); sortCardsBy.set(TAPi18n.__('due-date')); - Popup.close(); + Popup.back(); }, 'click .js-sort-title'() { const sortBy = { @@ -459,7 +459,7 @@ BlazeComponent.extendComponent({ }; Session.set('sortBy', sortBy); sortCardsBy.set(TAPi18n.__('title')); - Popup.close(); + Popup.back(); }, 'click .js-sort-created-asc'() { const sortBy = { @@ -467,7 +467,7 @@ BlazeComponent.extendComponent({ }; Session.set('sortBy', sortBy); sortCardsBy.set(TAPi18n.__('date-created-newest-first')); - Popup.close(); + Popup.back(); }, 'click .js-sort-created-desc'() { const sortBy = { @@ -475,7 +475,7 @@ BlazeComponent.extendComponent({ }; Session.set('sortBy', sortBy); sortCardsBy.set(TAPi18n.__('date-created-oldest-first')); - Popup.close(); + Popup.back(); }, }, ]; diff --git a/client/components/cards/minicard.js b/client/components/cards/minicard.js index d0c4929c4..4f8432621 100644 --- a/client/components/cards/minicard.js +++ b/client/components/cards/minicard.js @@ -106,7 +106,7 @@ BlazeComponent.extendComponent({ if (!Number.isNaN(sort)) { let card = this.data(); card.move(card.boardId, card.swimlaneId, card.listId, sort); - Popup.close(); + Popup.back(); } }, } diff --git a/client/components/lists/listBody.js b/client/components/lists/listBody.js index aa33e65c7..3ec189a21 100644 --- a/client/components/lists/listBody.js +++ b/client/components/lists/listBody.js @@ -496,7 +496,7 @@ BlazeComponent.extendComponent({ evt.preventDefault(); const linkedId = $('.js-select-cards option:selected').val(); if (!linkedId) { - Popup.close(); + Popup.back(); return; } const _id = Cards.insert({ @@ -511,7 +511,7 @@ BlazeComponent.extendComponent({ linkedId, }); Filter.addException(_id); - Popup.close(); + Popup.back(); }, 'click .js-link-board'(evt) { //LINK BOARD @@ -522,7 +522,7 @@ BlazeComponent.extendComponent({ !impBoardId || Cards.findOne({ linkedId: impBoardId, archived: false }) ) { - Popup.close(); + Popup.back(); return; } const _id = Cards.insert({ @@ -537,7 +537,7 @@ BlazeComponent.extendComponent({ linkedId: impBoardId, }); Filter.addException(_id); - Popup.close(); + Popup.back(); }, }, ]; @@ -584,7 +584,7 @@ BlazeComponent.extendComponent({ }); } if (!board) { - Popup.close(); + Popup.back(); return; } const boardId = board._id; @@ -711,7 +711,7 @@ BlazeComponent.extendComponent({ }, ); } - Popup.close(); + Popup.back(); }, }, ]; diff --git a/client/components/lists/listHeader.js b/client/components/lists/listHeader.js index e9a8b2676..f86274937 100644 --- a/client/components/lists/listHeader.js +++ b/client/components/lists/listHeader.js @@ -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(); }, }, ]; diff --git a/client/components/main/dueCards.js b/client/components/main/dueCards.js index 4841ddb27..f4d90ea56 100644 --- a/client/components/main/dueCards.js +++ b/client/components/main/dueCards.js @@ -38,12 +38,12 @@ BlazeComponent.extendComponent({ { 'click .js-due-cards-view-me'() { Utils.setDueCardsView('me'); - Popup.close(); + Popup.back(); }, 'click .js-due-cards-view-all'() { Utils.setDueCardsView('all'); - Popup.close(); + Popup.back(); }, }, ]; diff --git a/client/components/rules/actions/cardActions.js b/client/components/rules/actions/cardActions.js index 2290249ca..e319d7b7c 100644 --- a/client/components/rules/actions/cardActions.js +++ b/client/components/rules/actions/cardActions.js @@ -232,7 +232,7 @@ BlazeComponent.extendComponent({ }, 'click .js-submit'() { this.colorButtonValue.set(this.currentColor.get()); - Popup.close(); + Popup.back(); }, }, ]; diff --git a/client/components/rules/triggers/boardTriggers.js b/client/components/rules/triggers/boardTriggers.js index 66ee337ac..77e0c620e 100644 --- a/client/components/rules/triggers/boardTriggers.js +++ b/client/components/rules/triggers/boardTriggers.js @@ -116,6 +116,6 @@ Template.boardCardTitlePopup.events({ .trim(); Popup.getOpenerComponent().setNameFilter(title); event.preventDefault(); - Popup.close(); + Popup.back(); }, }); diff --git a/client/components/settings/peopleBody.js b/client/components/settings/peopleBody.js index f145d50de..ba415327d 100644 --- a/client/components/settings/peopleBody.js +++ b/client/components/settings/peopleBody.js @@ -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 { usernameMessageElement.hide(); emailMessageElement.hide(); - Popup.close(); + Popup.back(); } }, ); @@ -735,7 +735,7 @@ Template.editUserPopup.events({ } } else { usernameMessageElement.hide(); - Popup.close(); + Popup.back(); } }); } else if (isChangeEmail) { @@ -752,11 +752,11 @@ Template.editUserPopup.events({ } } else { emailMessageElement.hide(); - Popup.close(); + Popup.back(); } }, ); - } else Popup.close(); + } else Popup.back(); }, 'click #addUserOrg'(event) { event.preventDefault(); @@ -891,7 +891,7 @@ Template.newOrgPopup.events({ orgWebsite, orgIsActive, ); - Popup.close(); + Popup.back(); }, }); @@ -917,7 +917,7 @@ Template.newTeamPopup.events({ teamWebsite, teamIsActive, ); - Popup.close(); + Popup.back(); }, }); @@ -990,11 +990,11 @@ Template.newUserPopup.events({ } else { usernameMessageElement.hide(); emailMessageElement.hide(); - Popup.close(); + Popup.back(); } }, ); - Popup.close(); + Popup.back(); }, 'click #addUserOrgNewUser'(event) { event.preventDefault(); @@ -1048,7 +1048,7 @@ Template.settingsOrgPopup.events({ return; } Org.remove(this.orgId); - Popup.close(); + Popup.back(); } }); @@ -1066,7 +1066,7 @@ Template.settingsTeamPopup.events({ return; } Team.remove(this.teamId); - Popup.close(); + Popup.back(); } }); @@ -1099,7 +1099,7 @@ Template.settingsUserPopup.events({ // // */ - Popup.close(); + Popup.back(); }, }); diff --git a/client/components/sidebar/sidebar.js b/client/components/sidebar/sidebar.js index 1c3fdfd78..a295069e4 100644 --- a/client/components/sidebar/sidebar.js +++ b/client/components/sidebar/sidebar.js @@ -188,15 +188,15 @@ Template.boardMenuPopup.events({ 'click .js-rename-board': Popup.open('boardChangeTitle'), 'click .js-open-rules-view'() { Modal.openWide('rulesMain'); - Popup.close(); + Popup.back(); }, 'click .js-custom-fields'() { Sidebar.setView('customFields'); - Popup.close(); + Popup.back(); }, 'click .js-open-archives'() { Sidebar.setView('archives'); - Popup.close(); + Popup.back(); }, 'click .js-change-board-color': Popup.open('boardChangeColor'), 'click .js-change-language': Popup.open('changeLanguage'), @@ -209,7 +209,7 @@ Template.boardMenuPopup.events({ }), 'click .js-delete-board': Popup.afterConfirm('deleteBoard', function() { const currentBoard = Boards.findOne(Session.get('currentBoard')); - Popup.close(); + Popup.back(); Boards.remove(currentBoard._id); FlowRouter.go('home'); }), @@ -252,7 +252,7 @@ Template.boardMenuPopup.helpers({ Template.memberPopup.events({ 'click .js-filter-member'() { Filter.members.toggle(this.userId); - Popup.close(); + Popup.back(); }, 'click .js-change-role': Popup.open('changePermissions'), 'click .js-remove-member': Popup.afterConfirm('removeMember', function() { @@ -266,12 +266,12 @@ Template.memberPopup.events({ card.unassignAssignee(memberId); }); Boards.findOne(boardId).removeMember(memberId); - Popup.close(); + Popup.back(); }), 'click .js-leave-member': Popup.afterConfirm('leaveBoard', () => { const boardId = Session.get('currentBoard'); Meteor.call('quitBoard', boardId, () => { - Popup.close(); + Popup.back(); FlowRouter.go('home'); }); }), @@ -460,7 +460,7 @@ BlazeComponent.extendComponent({ activities: ['all'], }); } - Popup.close(); + Popup.back(); }, }, ]; @@ -1229,7 +1229,7 @@ BlazeComponent.extendComponent({ self.setLoading(false); if (err) self.setError(err.error); 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); - Popup.close(); + Popup.back(); }, '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); - Popup.close(); + Popup.back(); }, 'click #cancelLeaveBoardTeamBtn'(){ - Popup.close(); + Popup.back(); }, }, ]; diff --git a/client/components/sidebar/sidebarArchives.js b/client/components/sidebar/sidebarArchives.js index daddd464f..e9ef92ae1 100644 --- a/client/components/sidebar/sidebarArchives.js +++ b/client/components/sidebar/sidebarArchives.js @@ -94,13 +94,13 @@ BlazeComponent.extendComponent({ 'click .js-delete-card': Popup.afterConfirm('cardDelete', function() { const cardId = this._id; Cards.remove(cardId); - Popup.close(); + Popup.back(); }), 'click .js-delete-all-cards': Popup.afterConfirm('cardDelete', () => { this.archivedCards().forEach(card => { Cards.remove(card._id); }); - Popup.close(); + Popup.back(); }), 'click .js-restore-list'() { @@ -115,13 +115,13 @@ BlazeComponent.extendComponent({ 'click .js-delete-list': Popup.afterConfirm('listDelete', function() { this.remove(); - Popup.close(); + Popup.back(); }), 'click .js-delete-all-lists': Popup.afterConfirm('listDelete', () => { this.archivedLists().forEach(list => { list.remove(); }); - Popup.close(); + Popup.back(); }), 'click .js-restore-swimlane'() { @@ -138,7 +138,7 @@ BlazeComponent.extendComponent({ 'swimlaneDelete', function() { this.remove(); - Popup.close(); + Popup.back(); }, ), 'click .js-delete-all-swimlanes': Popup.afterConfirm( @@ -147,7 +147,7 @@ BlazeComponent.extendComponent({ this.archivedSwimlanes().forEach(swimlane => { swimlane.remove(); }); - Popup.close(); + Popup.back(); }, ), }, diff --git a/client/components/sidebar/sidebarCustomFields.js b/client/components/sidebar/sidebarCustomFields.js index dcd77aa16..0a35b08e6 100644 --- a/client/components/sidebar/sidebarCustomFields.js +++ b/client/components/sidebar/sidebarCustomFields.js @@ -283,7 +283,7 @@ const CreateCustomFieldPopup = BlazeComponent.extendComponent({ } else { CustomFields.remove(customField._id); } - Popup.close(); + Popup.back(); }, ), }, @@ -302,6 +302,6 @@ CreateCustomFieldPopup.register('createCustomFieldPopup'); 'submit'(evt) { const customFieldId = this._id; CustomFields.remove(customFieldId); - Popup.close(); + Popup.back(); } });*/ diff --git a/client/components/sidebar/sidebarFilters.js b/client/components/sidebar/sidebarFilters.js index dce993d44..ca76ead84 100644 --- a/client/components/sidebar/sidebarFilters.js +++ b/client/components/sidebar/sidebarFilters.js @@ -171,22 +171,22 @@ Template.multiselectionSidebar.helpers({ Template.disambiguateMultiLabelPopup.events({ 'click .js-remove-label'() { mutateSelectedCards('removeLabel', this._id); - Popup.close(); + Popup.back(); }, 'click .js-add-label'() { mutateSelectedCards('addLabel', this._id); - Popup.close(); + Popup.back(); }, }); Template.disambiguateMultiMemberPopup.events({ 'click .js-unassign-member'() { mutateSelectedCards('assignMember', this._id); - Popup.close(); + Popup.back(); }, 'click .js-assign-member'() { mutateSelectedCards('unassignMember', this._id); - Popup.close(); + Popup.back(); }, }); diff --git a/client/components/swimlanes/swimlaneHeader.js b/client/components/swimlanes/swimlaneHeader.js index b941d46ed..5b9398ba3 100644 --- a/client/components/swimlanes/swimlaneHeader.js +++ b/client/components/swimlanes/swimlaneHeader.js @@ -39,7 +39,7 @@ Template.swimlaneActionPopup.events({ 'click .js-close-swimlane'(event) { event.preventDefault(); this.archive(); - Popup.close(); + Popup.back(); }, 'click .js-move-swimlane': Popup.open('moveSwimlane'), 'click .js-copy-swimlane': Popup.open('copySwimlane'), @@ -88,7 +88,7 @@ BlazeComponent.extendComponent({ // XXX ideally, we should move the popup to the newly // created swimlane so a user can add more than one swimlane // with a minimum of interactions - Popup.close(); + Popup.back(); }, 'click .js-swimlane-template': Popup.open('searchElement'), }, @@ -118,11 +118,11 @@ BlazeComponent.extendComponent({ }, 'click .js-submit'() { this.currentSwimlane.setColor(this.currentColor.get()); - Popup.close(); + Popup.back(); }, 'click .js-remove-color'() { this.currentSwimlane.setColor(null); - Popup.close(); + Popup.back(); }, }, ]; diff --git a/client/components/swimlanes/swimlanes.js b/client/components/swimlanes/swimlanes.js index c099ed16e..83a112892 100644 --- a/client/components/swimlanes/swimlanes.js +++ b/client/components/swimlanes/swimlanes.js @@ -327,7 +327,7 @@ class MoveSwimlaneComponent extends BlazeComponent { boardId = bSelect.options[bSelect.selectedIndex].value; Meteor.call(this.serverMethod, this.currentSwimlane._id, boardId); } - Popup.close(); + Popup.back(); }, }, ]; diff --git a/client/components/users/userAvatar.js b/client/components/users/userAvatar.js index 00e63fa7f..22e5af524 100644 --- a/client/components/users/userAvatar.js +++ b/client/components/users/userAvatar.js @@ -290,7 +290,7 @@ Template.cardMemberPopup.helpers({ Template.cardMemberPopup.events({ 'click .js-remove-member'() { Cards.findOne(this.cardId).unassignMember(this.userId); - Popup.close(); + Popup.back(); }, 'click .js-edit-profile': Popup.open('editProfile'), }); diff --git a/client/components/users/userHeader.js b/client/components/users/userHeader.js index 1270eff39..08056e054 100644 --- a/client/components/users/userHeader.js +++ b/client/components/users/userHeader.js @@ -34,10 +34,10 @@ Template.memberMenuPopup.helpers({ Template.memberMenuPopup.events({ 'click .js-my-cards'() { - Popup.close(); + Popup.back(); }, 'click .js-due-cards'() { - Popup.close(); + Popup.back(); }, 'click .js-open-archived-board'() { Modal.open('archivedBoards'); @@ -53,7 +53,7 @@ Template.memberMenuPopup.events({ AccountsTemplates.logout(); }, 'click .js-go-setting'() { - Popup.close(); + Popup.back(); }, }); @@ -155,7 +155,7 @@ Template.editProfilePopup.events({ } else Popup.back(); }, 'click #deleteButton': Popup.afterConfirm('userDelete', function() { - Popup.close(); + Popup.back(); Users.remove(Meteor.userId()); AccountsTemplates.logout(); }), From 4936e580fd997b8b1f6ab2854d2bd413f110f013 Mon Sep 17 00:00:00 2001 From: Martin Filser Date: Thu, 21 Oct 2021 13:16:51 +0200 Subject: [PATCH 3/9] Board search open the minicard as Popup --- client/components/sidebar/sidebarSearches.jade | 6 +++++- client/components/sidebar/sidebarSearches.js | 15 ++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/client/components/sidebar/sidebarSearches.jade b/client/components/sidebar/sidebarSearches.jade index 212ba57a2..21fc90586 100644 --- a/client/components/sidebar/sidebarSearches.jade +++ b/client/components/sidebar/sidebarSearches.jade @@ -3,10 +3,14 @@ template(name="searchSidebar") input(type="text" name="searchTerm" placeholder="{{_ 'search-example'}}" autofocus dir="auto") .list-body .minilists.clearfix.js-minilists + hr + {{_ 'lists' }} each (lists) a.minilist-wrapper.js-minilist(href=originRelativeUrl) +minilist(this) .minicards.clearfix.js-minicards - each (results) + hr + {{_ 'cards' }} + each (cards) a.minicard-wrapper.js-minicard(href=originRelativeUrl) +minicard(this) diff --git a/client/components/sidebar/sidebarSearches.js b/client/components/sidebar/sidebarSearches.js index 026772601..35c172960 100644 --- a/client/components/sidebar/sidebarSearches.js +++ b/client/components/sidebar/sidebarSearches.js @@ -3,7 +3,7 @@ BlazeComponent.extendComponent({ this.term = new ReactiveVar(''); }, - results() { + cards() { const currentBoard = Boards.findOne(Session.get('currentBoard')); return currentBoard.searchCards(this.term.get()); }, @@ -13,9 +13,22 @@ BlazeComponent.extendComponent({ return currentBoard.searchLists(this.term.get()); }, + clickOnMiniCard(evt) { + evt.preventDefault(); + Session.set('popupCard', this.currentData()._id); + this.cardDetailsPopup(evt); + }, + + cardDetailsPopup(event) { + if (!Popup.isOpen()) { + Popup.open("cardDetails")(event); + } + }, + events() { return [ { + 'click .js-minicard': this.clickOnMiniCard, 'submit .js-search-term-form'(evt) { evt.preventDefault(); this.term.set(evt.target.searchTerm.value); From 4131dd89d4c2df5c4015f57d2fe47f7e8a7c9de2 Mon Sep 17 00:00:00 2001 From: Martin Filser Date: Thu, 21 Oct 2021 13:34:36 +0200 Subject: [PATCH 4/9] Global search open the minicard as Popup --- client/components/cards/resultCard.jade | 2 +- client/components/cards/resultCard.js | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/client/components/cards/resultCard.jade b/client/components/cards/resultCard.jade index cf001532b..ae6e90722 100644 --- a/client/components/cards/resultCard.jade +++ b/client/components/cards/resultCard.jade @@ -1,6 +1,6 @@ template(name="resultCard") .result-card-wrapper - a.minicard-wrapper.card-title(href=originRelativeUrl) + a.minicard-wrapper.js-minicard.card-title(href=originRelativeUrl) +minicard(this) //= card.title ul.result-card-context-list diff --git a/client/components/cards/resultCard.js b/client/components/cards/resultCard.js index 3b5da12cf..89632b97a 100644 --- a/client/components/cards/resultCard.js +++ b/client/components/cards/resultCard.js @@ -5,7 +5,23 @@ Template.resultCard.helpers({ }); BlazeComponent.extendComponent({ + clickOnMiniCard(evt) { + evt.preventDefault(); + Session.set('popupCard', this.currentData()._id); + this.cardDetailsPopup(evt); + }, + + cardDetailsPopup(event) { + if (!Popup.isOpen()) { + Popup.open("cardDetails")(event); + } + }, + events() { - return [{}]; + return [ + { + 'click .js-minicard': this.clickOnMiniCard, + }, + ]; }, }).register('resultCard'); From cdc4be3a13c0ed7bfb1bf1f0d3424cd2d27f8ca3 Mon Sep 17 00:00:00 2001 From: Martin Filser Date: Thu, 21 Oct 2021 14:18:18 +0200 Subject: [PATCH 5/9] Card Details Popup in Desktop View has (for now) no maximize button --- client/components/cards/cardDetails.jade | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/client/components/cards/cardDetails.jade b/client/components/cards/cardDetails.jade index 9f079bc64..c41cd0134 100644 --- a/client/components/cards/cardDetails.jade +++ b/client/components/cards/cardDetails.jade @@ -8,11 +8,12 @@ template(name="cardDetails") +editCardTitleForm else unless isMiniScreen - a.fa.fa-times-thin.close-card-details.js-close-card-details(title="{{_ 'close-card'}}") - unless cardMaximized - a.fa.fa-window-maximize.maximize-card-details.js-maximize-card-details(title="{{_ 'maximize-card'}}") - if cardMaximized - a.fa.fa-window-minimize.minimize-card-details.js-minimize-card-details(title="{{_ 'minimize-card'}}") + unless isPopup + a.fa.fa-times-thin.close-card-details.js-close-card-details(title="{{_ 'close-card'}}") + if cardMaximized + a.fa.fa-window-minimize.minimize-card-details.js-minimize-card-details(title="{{_ 'minimize-card'}}") + else + a.fa.fa-window-maximize.maximize-card-details.js-maximize-card-details(title="{{_ 'maximize-card'}}") if currentUser.isBoardMember a.fa.fa-navicon.card-details-menu.js-open-card-details-menu(title="{{_ 'cardDetailsActionsPopup-title'}}") input.inline-input(type="text" id="cardURL_copy" value="{{ originRelativeUrl }}") @@ -20,7 +21,7 @@ template(name="cardDetails") class="fa-link" title="{{_ 'copy-card-link-to-clipboard'}}" ) - if isMiniScreen + else unless isPopup a.fa.fa-times-thin.close-card-details.js-close-card-details(title="{{_ 'close-card'}}") if currentUser.isBoardMember From e6f94c9d1626aa172b75f9bdeb7372e80395d410 Mon Sep 17 00:00:00 2001 From: Martin Filser Date: Thu, 21 Oct 2021 23:18:22 +0200 Subject: [PATCH 6/9] Move card to top - close Popup / back to previous popup --- client/components/cards/cardDetails.js | 1 + 1 file changed, 1 insertion(+) diff --git a/client/components/cards/cardDetails.js b/client/components/cards/cardDetails.js index 951e26ee8..aee618976 100644 --- a/client/components/cards/cardDetails.js +++ b/client/components/cards/cardDetails.js @@ -680,6 +680,7 @@ Template.cardDetailsActionsPopup.events({ .map((c) => c.sort), ); this.move(this.boardId, this.swimlaneId, this.listId, minOrder - 1); + Popup.back(); }, 'click .js-move-card-to-bottom'(event) { event.preventDefault(); From 0313e21ca1b3d18c16ce91abcf4ae44509bff0ca Mon Sep 17 00:00:00 2001 From: Martin Filser Date: Sat, 23 Oct 2021 23:36:00 +0200 Subject: [PATCH 7/9] Fix, move to top now works after moving the card (card details action popup) --- client/components/cards/cardDetails.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/client/components/cards/cardDetails.js b/client/components/cards/cardDetails.js index aee618976..4ea82cbc7 100644 --- a/client/components/cards/cardDetails.js +++ b/client/components/cards/cardDetails.js @@ -820,6 +820,12 @@ Template.moveCardPopup.events({ const slSelect = $('.js-select-swimlanes')[0]; const swimlaneId = slSelect.options[slSelect.selectedIndex].value; card.move(boardId, swimlaneId, listId, 0); + + // set new id's to card object in case the card is moved to top by the comment "moveCard" after this command (.js-move-card) + this.boardId = boardId; + this.swimlaneId = swimlaneId; + this.listId = listId; + Popup.back(); }, }); From 876d78eec40884faa6f760db8ff1885ef7dcf35b Mon Sep 17 00:00:00 2001 From: Martin Filser Date: Fri, 22 Oct 2021 15:33:40 +0200 Subject: [PATCH 8/9] Card Details Popup, Checklist-Items are now displayed if opened from Global Search --- server/publications/cards.js | 1 + 1 file changed, 1 insertion(+) diff --git a/server/publications/cards.js b/server/publications/cards.js index ce35aff2f..57c4662cc 100644 --- a/server/publications/cards.js +++ b/server/publications/cards.js @@ -713,6 +713,7 @@ function findCards(sessionId, query) { CustomFields.find({ _id: { $in: customFieldIds } }), Users.find({ _id: { $in: users } }, { fields: Users.safeFields }), Checklists.find({ cardId: { $in: cards.map(c => c._id) } }), + ChecklistItems.find({ cardId: { $in: cards.map(c => c._id) } }), Attachments.find({ cardId: { $in: cards.map(c => c._id) } }), CardComments.find({ cardId: { $in: cards.map(c => c._id) } }), SessionData.find({ userId, sessionId }), From ce30c7e1b7e4d7292c08549b1cb508ca763c2624 Mon Sep 17 00:00:00 2001 From: Martin Filser Date: Thu, 21 Oct 2021 23:54:30 +0200 Subject: [PATCH 9/9] Card Details, show card link in mobile view --- client/components/cards/cardDetails.jade | 7 +++++-- client/components/cards/cardDetails.js | 3 ++- client/components/cards/cardDetails.styl | 9 --------- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/client/components/cards/cardDetails.jade b/client/components/cards/cardDetails.jade index c41cd0134..ea6be9388 100644 --- a/client/components/cards/cardDetails.jade +++ b/client/components/cards/cardDetails.jade @@ -16,19 +16,22 @@ template(name="cardDetails") a.fa.fa-window-maximize.maximize-card-details.js-maximize-card-details(title="{{_ 'maximize-card'}}") if currentUser.isBoardMember a.fa.fa-navicon.card-details-menu.js-open-card-details-menu(title="{{_ 'cardDetailsActionsPopup-title'}}") - input.inline-input(type="text" id="cardURL_copy" value="{{ originRelativeUrl }}") a.fa.fa-link.card-copy-button.js-copy-link( + id="cardURL_copy" class="fa-link" title="{{_ 'copy-card-link-to-clipboard'}}" + href="{{ originRelativeUrl }}" ) else unless isPopup a.fa.fa-times-thin.close-card-details.js-close-card-details(title="{{_ 'close-card'}}") if currentUser.isBoardMember a.fa.fa-navicon.card-details-menu-mobile-web.js-open-card-details-menu(title="{{_ 'cardDetailsActionsPopup-title'}}") - a.fa.fa-link.card-copy-mobile-button( + a.fa.fa-link.card-copy-mobile-button.js-copy-link( + id="cardURL_copy" class="fa-link" title="{{_ 'copy-card-link-to-clipboard'}}" + href="{{ originRelativeUrl }}" ) h2.card-details-title.js-card-title( class="{{#if canModifyCard}}js-open-inlined-form is-editable{{/if}}") diff --git a/client/components/cards/cardDetails.js b/client/components/cards/cardDetails.js index 4ea82cbc7..12d212248 100644 --- a/client/components/cards/cardDetails.js +++ b/client/components/cards/cardDetails.js @@ -323,7 +323,8 @@ BlazeComponent.extendComponent({ 'click .js-close-card-details'() { Utils.goBoardId(this.data().boardId); }, - 'click .js-copy-link'() { + 'click .js-copy-link'(event) { + event.preventDefault(); const StringToCopyElement = document.getElementById('cardURL_copy'); StringToCopyElement.value = window.location.origin + window.location.pathname; diff --git a/client/components/cards/cardDetails.styl b/client/components/cards/cardDetails.styl index c0feee0ce..9d1be7f70 100644 --- a/client/components/cards/cardDetails.styl +++ b/client/components/cards/cardDetails.styl @@ -4,15 +4,6 @@ avatar-radius = 50% -#cardURL_copy - // Have clipboard text not visible by moving it to far left - position: absolute - left: -2000px - top: 0px - -#clipboard - white-space: normal - .assignee border-radius: 3px display: block