mirror of
https://github.com/wekan/wekan.git
synced 2026-01-29 20:56:09 +01:00
Merge branch 'master' of https://github.com/wekan/wekan into issue881
This commit is contained in:
commit
75f15f1be2
46 changed files with 215 additions and 52 deletions
|
|
@ -66,7 +66,7 @@ template(name="editChecklistItemForm")
|
|||
|
||||
template(name="checklistItems")
|
||||
.checklist-items.js-checklist-items
|
||||
each item in checklist.getItems
|
||||
each item in checklist.getItemsSorted
|
||||
+inlinedForm(classNames="js-edit-checklist-item" item = item checklist = checklist)
|
||||
+editChecklistItemForm(type = 'item' item = item checklist = checklist)
|
||||
else
|
||||
|
|
|
|||
|
|
@ -20,24 +20,26 @@ function initSorting(items) {
|
|||
});
|
||||
items.sortable('cancel');
|
||||
const formerParent = ui.item.parents('.js-checklist-items');
|
||||
let checklist = Blaze.getData(parent.get(0)).checklist;
|
||||
const checklist = Blaze.getData(parent.get(0)).checklist;
|
||||
const oldChecklist = Blaze.getData(formerParent.get(0)).checklist;
|
||||
if (oldChecklist._id !== checklist._id) {
|
||||
const currentItem = Blaze.getData(ui.item.get(0)).item;
|
||||
for (let i = 0; i < orderedItems.length; i++) {
|
||||
let itemId = orderedItems[i];
|
||||
const itemId = orderedItems[i];
|
||||
if (itemId !== currentItem._id) continue;
|
||||
checklist.addItem(currentItem.title);
|
||||
checklist = Checklists.findOne({_id: checklist._id});
|
||||
itemId = checklist._id + (checklist.newItemIndex - 1);
|
||||
if (currentItem.finished) {
|
||||
checklist.finishItem(itemId);
|
||||
}
|
||||
orderedItems[i] = itemId;
|
||||
oldChecklist.removeItem(currentItem._id);
|
||||
const newItem = {
|
||||
_id: checklist.getNewItemId(),
|
||||
title: currentItem.title,
|
||||
sort: i,
|
||||
isFinished: currentItem.isFinished,
|
||||
};
|
||||
checklist.addFullItem(newItem);
|
||||
orderedItems[i] = currentItem._id;
|
||||
oldChecklist.removeItem(itemId);
|
||||
}
|
||||
} else {
|
||||
checklist.sortItems(orderedItems);
|
||||
}
|
||||
checklist.sortItems(orderedItems);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,13 +69,16 @@
|
|||
padding-left: 10px
|
||||
color: #a6a6a6
|
||||
|
||||
.list-header-menu-icon
|
||||
.list-header-menu
|
||||
position: absolute
|
||||
padding: 7px
|
||||
margin-top: 1px
|
||||
top: -@padding
|
||||
right: -@padding
|
||||
|
||||
.list-header-plus-icon
|
||||
color: #a6a6a6
|
||||
|
||||
.list-body
|
||||
flex: 1
|
||||
display: flex
|
||||
|
|
|
|||
|
|
@ -13,7 +13,9 @@ template(name="listHeader")
|
|||
if currentUser.isBoardMember
|
||||
if isWatching
|
||||
i.list-header-watch-icon.fa.fa-eye
|
||||
a.list-header-menu-icon.fa.fa-navicon.js-open-list-menu
|
||||
div.list-header-menu
|
||||
a.js-add-card.fa.fa-plus.list-header-plus-icon
|
||||
a.fa.fa-navicon.js-open-list-menu
|
||||
|
||||
template(name="editListTitleForm")
|
||||
.list-composer
|
||||
|
|
@ -28,10 +30,9 @@ template(name="listActionPopup")
|
|||
unless currentUser.isCommentOnly
|
||||
hr
|
||||
ul.pop-over-list
|
||||
li: a.js-add-card {{_ 'add-card'}}
|
||||
if cards.count
|
||||
li: a.js-select-cards {{_ 'list-select-cards'}}
|
||||
hr
|
||||
hr
|
||||
ul.pop-over-list
|
||||
li: a.js-close-list {{_ 'archive-list'}}
|
||||
hr
|
||||
|
|
|
|||
|
|
@ -24,6 +24,13 @@ BlazeComponent.extendComponent({
|
|||
events() {
|
||||
return [{
|
||||
'click .js-open-list-menu': Popup.open('listAction'),
|
||||
'click .js-add-card' () {
|
||||
const listDom = document.getElementById(`js-list-${this.currentData()._id}`);
|
||||
const listComponent = BlazeComponent.getComponentForElement(listDom);
|
||||
listComponent.openForm({
|
||||
position: 'top',
|
||||
});
|
||||
},
|
||||
submit: this.editTitle,
|
||||
}];
|
||||
},
|
||||
|
|
@ -36,14 +43,6 @@ Template.listActionPopup.helpers({
|
|||
});
|
||||
|
||||
Template.listActionPopup.events({
|
||||
'click .js-add-card' () {
|
||||
const listDom = document.getElementById(`js-list-${this._id}`);
|
||||
const listComponent = BlazeComponent.getComponentForElement(listDom);
|
||||
listComponent.openForm({
|
||||
position: 'top',
|
||||
});
|
||||
Popup.close();
|
||||
},
|
||||
'click .js-list-subscribe' () {},
|
||||
'click .js-select-cards' () {
|
||||
const cardIds = this.allCards().map((card) => card._id);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue