mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 20:49:20 +03:00
Added addComputables() to *Model
This commit is contained in:
parent
22f606ea75
commit
b165a1de4f
6 changed files with 221 additions and 223 deletions
|
|
@ -1,5 +1,3 @@
|
|||
import ko from 'ko';
|
||||
|
||||
import { ContactPropertyType } from 'Common/Enums';
|
||||
import { pInt, pString } from 'Common/Utils';
|
||||
import { i18n } from 'Common/Translator';
|
||||
|
|
@ -26,12 +24,14 @@ class ContactPropertyModel extends AbstractModel {
|
|||
placeholder: placeholder
|
||||
});
|
||||
|
||||
this.placeholderValue = ko.computed(() => {
|
||||
const v = this.placeholder();
|
||||
return v ? i18n(v) : '';
|
||||
});
|
||||
this.addComputables({
|
||||
placeholderValue: () => {
|
||||
const v = this.placeholder();
|
||||
return v ? i18n(v) : '';
|
||||
},
|
||||
|
||||
this.largeValue = ko.computed(() => ContactPropertyType.Note === this.type());
|
||||
largeValue: () => ContactPropertyType.Note === this.type()
|
||||
});
|
||||
}
|
||||
|
||||
toJSON() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue