mirror of
https://github.com/wekan/wekan.git
synced 2026-01-06 09:38:49 +01:00
Use Utils#getCurrentCard() everywhere in the code
This commit is contained in:
parent
7a6cfcb498
commit
fdf40f4584
10 changed files with 21 additions and 21 deletions
|
|
@ -3,7 +3,7 @@ import Cards from '/models/cards';
|
|||
|
||||
Template.cardCustomFieldsPopup.helpers({
|
||||
hasCustomField() {
|
||||
const card = Cards.findOne(Session.get('currentCard'));
|
||||
const card = Utils.getCurrentCard();
|
||||
const customFieldId = this._id;
|
||||
return card.customFieldIndex(customFieldId) > -1;
|
||||
},
|
||||
|
|
@ -11,7 +11,7 @@ Template.cardCustomFieldsPopup.helpers({
|
|||
|
||||
Template.cardCustomFieldsPopup.events({
|
||||
'click .js-select-field'(event) {
|
||||
const card = Cards.findOne(Session.get('currentCard'));
|
||||
const card = Utils.getCurrentCard();
|
||||
const customFieldId = this._id;
|
||||
card.toggleCustomField(customFieldId);
|
||||
event.preventDefault();
|
||||
|
|
@ -31,7 +31,7 @@ const CardCustomField = BlazeComponent.extendComponent({
|
|||
|
||||
onCreated() {
|
||||
const self = this;
|
||||
self.card = Cards.findOne(Session.get('currentCard'));
|
||||
self.card = Utils.getCurrentCard();
|
||||
self.customFieldId = this.data()._id;
|
||||
},
|
||||
|
||||
|
|
@ -194,7 +194,7 @@ CardCustomField.register('cardCustomField');
|
|||
onCreated() {
|
||||
super.onCreated();
|
||||
const self = this;
|
||||
self.card = Cards.findOne(Session.get('currentCard'));
|
||||
self.card = Utils.getCurrentCard();
|
||||
self.customFieldId = this.data()._id;
|
||||
this.data().value && this.date.set(moment(this.data().value));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue