mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-01 21:49:21 +03:00
Prevent memory leaks in *Model
This commit is contained in:
parent
48a9a03762
commit
d7a4639d6b
22 changed files with 221 additions and 225 deletions
|
|
@ -17,12 +17,14 @@ class ContactPropertyModel extends AbstractModel {
|
|||
constructor(type = ContactPropertyType.Unknown, typeStr = '', value = '', focused = false, placeholder = '') {
|
||||
super();
|
||||
|
||||
this.type = ko.observable(pInt(type));
|
||||
this.typeStr = ko.observable(pString(typeStr));
|
||||
this.focused = ko.observable(!!focused);
|
||||
this.value = ko.observable(pString(value));
|
||||
this.addObservables({
|
||||
type: pInt(type),
|
||||
typeStr: pString(typeStr),
|
||||
focused: !!focused,
|
||||
value: pString(value),
|
||||
|
||||
this.placeholder = ko.observable(placeholder);
|
||||
placeholder: placeholder
|
||||
});
|
||||
|
||||
this.placeholderValue = ko.computed(() => {
|
||||
const v = this.placeholder();
|
||||
|
|
@ -30,8 +32,6 @@ class ContactPropertyModel extends AbstractModel {
|
|||
});
|
||||
|
||||
this.largeValue = ko.computed(() => ContactPropertyType.Note === this.type());
|
||||
|
||||
this.regDisposables([this.placeholderValue, this.largeValue]);
|
||||
}
|
||||
|
||||
toJSON() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue