mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-26 18:49:20 +03:00
Cleanup component models
This commit is contained in:
parent
536a9d20fd
commit
5748dea4bc
6 changed files with 71 additions and 105 deletions
|
|
@ -1,16 +1,14 @@
|
|||
import ko from 'ko';
|
||||
import { pInt } from 'Common/Utils';
|
||||
import { SaveSettingsStep } from 'Common/Enums';
|
||||
import { AbstractComponent } from 'Component/Abstract';
|
||||
import { koComputable } from 'External/ko';
|
||||
import { dispose } from 'External/ko';
|
||||
|
||||
class AbstractInput extends AbstractComponent {
|
||||
export class AbstractInput {
|
||||
/**
|
||||
* @param {Object} params
|
||||
*/
|
||||
constructor(params) {
|
||||
super();
|
||||
|
||||
this.value = params.value || '';
|
||||
this.label = params.label || '';
|
||||
this.enable = null == params.enable ? true : params.enable;
|
||||
|
|
@ -43,13 +41,17 @@ class AbstractInput extends AbstractComponent {
|
|||
(size + ' settings-saved-trigger-input ' + classForTrigger()).trim()
|
||||
);
|
||||
|
||||
this.disposable.push(this.trigger.subscribe(setTriggerState, this));
|
||||
this.disposable = [
|
||||
this.trigger.subscribe(setTriggerState, this),
|
||||
this.className
|
||||
];
|
||||
} else {
|
||||
this.className = size;
|
||||
this.disposable = [];
|
||||
}
|
||||
}
|
||||
|
||||
this.disposable.push(this.className);
|
||||
dispose() {
|
||||
this.disposable.forEach(dispose);
|
||||
}
|
||||
}
|
||||
|
||||
export { AbstractInput };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue