mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 20:19:22 +03:00
Removed CheckboxSimple component (was only used at login)
This commit is contained in:
parent
976b1d54bd
commit
456f304338
8 changed files with 38 additions and 61 deletions
|
|
@ -1,23 +0,0 @@
|
|||
import ko from 'ko';
|
||||
|
||||
export class AbstractCheckbox {
|
||||
/**
|
||||
* @param {Object} params = {}
|
||||
*/
|
||||
constructor(params = {}) {
|
||||
this.value = ko.isObservable(params.value) ? params.value
|
||||
: ko.observable(!!params.value);
|
||||
|
||||
this.enable = ko.isObservable(params.enable) ? params.enable
|
||||
: ko.observable(undefined === params.enable || !!params.enable);
|
||||
|
||||
this.label = params.label || '';
|
||||
this.inline = !!params.inline;
|
||||
|
||||
this.labeled = undefined !== params.label;
|
||||
}
|
||||
|
||||
click() {
|
||||
this.enable() && this.value(!this.value());
|
||||
}
|
||||
}
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
import { AbstractCheckbox } from 'Component/AbstractCheckbox';
|
||||
|
||||
export class CheckboxComponent extends AbstractCheckbox {}
|
||||
|
|
@ -1,3 +1,18 @@
|
|||
import { AbstractCheckbox } from 'Component/AbstractCheckbox';
|
||||
export class CheckboxMaterialDesignComponent {
|
||||
constructor(params = {}) {
|
||||
this.value = ko.isObservable(params.value) ? params.value
|
||||
: ko.observable(!!params.value);
|
||||
|
||||
export class CheckboxMaterialDesignComponent extends AbstractCheckbox {}
|
||||
this.enable = ko.isObservable(params.enable) ? params.enable
|
||||
: ko.observable(undefined === params.enable || !!params.enable);
|
||||
|
||||
this.label = params.label;
|
||||
this.inline = params.inline;
|
||||
|
||||
this.labeled = null != params.label;
|
||||
}
|
||||
|
||||
click() {
|
||||
this.enable() && this.value(!this.value());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue