mirror of
https://github.com/wekan/wekan.git
synced 2026-02-12 19:24:20 +01:00
Convert checklist-item to card uses now the same code as copy card / move card
This commit is contained in:
parent
3e921da314
commit
15ce816ec6
3 changed files with 23 additions and 44 deletions
|
|
@ -1047,16 +1047,17 @@ class DialogWithBoardSwimlaneList extends BlazeComponent {
|
|||
}
|
||||
}).register('copyCardPopup');
|
||||
|
||||
Template.convertChecklistItemToCardPopup.events({
|
||||
'click .js-done'() {
|
||||
const card = Utils.getCurrentCard();
|
||||
const lSelect = $('.js-select-lists')[0];
|
||||
const listId = lSelect.options[lSelect.selectedIndex].value;
|
||||
const slSelect = $('.js-select-swimlanes')[0];
|
||||
const swimlaneId = slSelect.options[slSelect.selectedIndex].value;
|
||||
const bSelect = $('.js-select-boards')[0];
|
||||
const boardId = bSelect.options[bSelect.selectedIndex].value;
|
||||
const textarea = $('#copy-card-title');
|
||||
/** Convert Checklist-Item to card dialog */
|
||||
(class extends DialogWithBoardSwimlaneList {
|
||||
getCardDialogOptions() {
|
||||
const ret = Meteor.user().getMoveAndCopyDialogOptions();
|
||||
return ret;
|
||||
}
|
||||
setDone(boardId, swimlaneId, listId, options) {
|
||||
Meteor.user().setMoveAndCopyDialogOption(this.currentBoardId, options);
|
||||
const card = this.data();
|
||||
|
||||
const textarea = this.$('#copy-card-title');
|
||||
const title = textarea.val().trim();
|
||||
|
||||
if (title) {
|
||||
|
|
@ -1067,13 +1068,14 @@ Template.convertChecklistItemToCardPopup.events({
|
|||
swimlaneId: swimlaneId,
|
||||
sort: 0,
|
||||
});
|
||||
const card = Cards.findOne(_id);
|
||||
const minOrder = card.getMinSort();
|
||||
card.move(card.boardId, card.swimlaneId, card.listId, minOrder - 1);
|
||||
|
||||
Filter.addException(_id);
|
||||
|
||||
Popup.back();
|
||||
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
}).register('convertChecklistItemToCardPopup');
|
||||
|
||||
/** Copy many cards dialog */
|
||||
(class extends DialogWithBoardSwimlaneList {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue