|
@@ -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() {
|