summaryrefslogtreecommitdiffstats
path: root/client/components/cards/cardCustomFields.js
diff options
context:
space:
mode:
authorPouyan Savoli <papoola@hotmail.com>2017-09-14 00:50:05 +0200
committerPouyan Savoli <papoola@hotmail.com>2017-09-22 22:59:32 +0200
commitcaad952bc1b29bb925c1347a14daa5d1ec8ada81 (patch)
tree73b88d891f3204485d4aa3ea996ea2dba620a8ce /client/components/cards/cardCustomFields.js
parent6ff89b43b61ace7ea26d50f091ea6b714fa79c84 (diff)
downloadwekan-caad952bc1b29bb925c1347a14daa5d1ec8ada81.tar.gz
wekan-caad952bc1b29bb925c1347a14daa5d1ec8ada81.tar.bz2
wekan-caad952bc1b29bb925c1347a14daa5d1ec8ada81.zip
text custom fields are now editable using inlinedForm
Diffstat (limited to 'client/components/cards/cardCustomFields.js')
-rw-r--r--client/components/cards/cardCustomFields.js21
1 files changed, 20 insertions, 1 deletions
diff --git a/client/components/cards/cardCustomFields.js b/client/components/cards/cardCustomFields.js
index 73dda02e..7009dede 100644
--- a/client/components/cards/cardCustomFields.js
+++ b/client/components/cards/cardCustomFields.js
@@ -1,3 +1,11 @@
+Template.cardCustomFieldsPopup.helpers({
+ hasCustomField() {
+ const card = Cards.findOne(Session.get('currentCard'));
+ const customFieldId = this._id;
+ return card.customFieldIndex(customFieldId) > -1;
+ },
+});
+
Template.cardCustomFieldsPopup.events({
'click .js-select-field'(evt) {
const card = Cards.findOne(Session.get('currentCard'));
@@ -24,7 +32,7 @@ const CardCustomField = BlazeComponent.extendComponent({
},
value() {
- return "this is the value";
+ return this.data().value;
},
showISODate() {
@@ -33,9 +41,20 @@ const CardCustomField = BlazeComponent.extendComponent({
events() {
return [{
+ 'submit .js-card-customfield-text'(evt) {
+ evt.preventDefault();
+ const card = Cards.findOne(Session.get('currentCard'));
+ const customFieldId = this.data()._id;
+ const value = this.currentComponent().getValue();
+ card.setCustomField(customFieldId,value);
+ },
'click .js-edit-date': Popup.open('editCardStartDate'),
}];
},
+
+ canModifyCard() {
+ return Meteor.user() && Meteor.user().isBoardMember() && !Meteor.user().isCommentOnly();
+ },
});
CardCustomField.register('cardCustomField'); \ No newline at end of file