mirror of
https://github.com/wekan/wekan.git
synced 2025-09-22 01:50:48 +02:00
card model and card ui preparation for custom fields #2
This commit is contained in:
parent
d87191f17e
commit
733b14dcd8
2 changed files with 10 additions and 5 deletions
|
@ -71,16 +71,17 @@
|
|||
.card-details-items
|
||||
display: flex
|
||||
flex-wrap: wrap
|
||||
margin: 15px 0
|
||||
margin: 0 0 15px
|
||||
|
||||
.card-details-item
|
||||
margin-right: 0.5em
|
||||
margin: 15px 0.5em 0 0
|
||||
&:last-child
|
||||
margin-right: 0
|
||||
&.card-details-item-labels,
|
||||
&.card-details-item-members,
|
||||
&.card-details-item-start,
|
||||
&.card-details-item-due
|
||||
&.card-details-item-due,
|
||||
&.card-details-item-customfield
|
||||
max-width: 50%
|
||||
flex-grow: 1
|
||||
|
||||
|
|
|
@ -186,6 +186,10 @@ Cards.helpers({
|
|||
return this.checklistItemCount() !== 0;
|
||||
},
|
||||
|
||||
customFieldIndex(customFieldId) {
|
||||
return _.pluck(this.customFields, '_id').indexOf(customFieldId);
|
||||
},
|
||||
|
||||
absoluteUrl() {
|
||||
const board = this.board();
|
||||
return FlowRouter.url('card', {
|
||||
|
@ -255,7 +259,7 @@ Cards.mutations({
|
|||
|
||||
assignCustomField(customFieldId) {
|
||||
console.log("assignCustomField", customFieldId);
|
||||
return {$push: {customFields: {_id: customFieldId, value: null}}};
|
||||
return {$addToSet: {customFields: {_id: customFieldId, value: null}}};
|
||||
},
|
||||
|
||||
unassignCustomField(customFieldId) {
|
||||
|
@ -264,7 +268,7 @@ Cards.mutations({
|
|||
},
|
||||
|
||||
toggleCustomField(customFieldId) {
|
||||
if (this.customFields && this.customFields[customFieldId]) {
|
||||
if (this.customFields && this.customFieldIndex(customFieldId) > -1) {
|
||||
return this.unassignCustomField(customFieldId);
|
||||
} else {
|
||||
return this.assignCustomField(customFieldId);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue