mirror of
https://github.com/wekan/wekan.git
synced 2026-01-23 09:46:09 +01:00
add 'cardCustomField-currency' template
This commit is contained in:
parent
3cf6ed916f
commit
54b9035eb2
2 changed files with 42 additions and 0 deletions
|
|
@ -80,6 +80,31 @@ CardCustomField.register('cardCustomField');
|
|||
}
|
||||
}.register('cardCustomField-number'));
|
||||
|
||||
// cardCustomField-currency
|
||||
(class extends CardCustomField {
|
||||
onCreated() {
|
||||
super.onCreated();
|
||||
|
||||
this.currencySymbol = this.data().definition.settings.currencySymbol;
|
||||
}
|
||||
|
||||
formattedValue() {
|
||||
return `${this.currencySymbol}${this.data().value}`;
|
||||
}
|
||||
|
||||
events() {
|
||||
return [
|
||||
{
|
||||
'submit .js-card-customfield-currency'(event) {
|
||||
event.preventDefault();
|
||||
const value = Number(this.find('input').value, 10);
|
||||
this.card.setCustomField(this.customFieldId, value);
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
||||
}.register('cardCustomField-currency'));
|
||||
|
||||
// cardCustomField-date
|
||||
(class extends CardCustomField {
|
||||
onCreated() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue