mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-06-28 23:05:54 +00:00
isArray to native Array.isArray
isUnd(*) to native undefined === *
isFunc to native typeof * === 'function'
isObject to native typeof * === 'object'
microtime() to native Date().getTime();
noop to native ()=>{}
noopFalse to native ()=>false
noopTrue to native ()=>true
boolToAjax to native *?'1':'0'
Underscore.js to native
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import ko from 'ko';
|
||||
import { isUnd } from 'Common/Utils';
|
||||
import { AbstractComponent } from 'Component/Abstract';
|
||||
|
||||
class AbstractCheckbox extends AbstractComponent {
|
||||
@@ -10,27 +9,27 @@ class AbstractCheckbox extends AbstractComponent {
|
||||
super();
|
||||
|
||||
this.value = params.value;
|
||||
if (isUnd(this.value) || !this.value.subscribe) {
|
||||
this.value = ko.observable(isUnd(this.value) ? false : !!this.value);
|
||||
if (undefined === this.value || !this.value.subscribe) {
|
||||
this.value = ko.observable(undefined === this.value ? false : !!this.value);
|
||||
}
|
||||
|
||||
this.enable = params.enable;
|
||||
if (isUnd(this.enable) || !this.enable.subscribe) {
|
||||
this.enable = ko.observable(isUnd(this.enable) ? true : !!this.enable);
|
||||
if (undefined === this.enable || !this.enable.subscribe) {
|
||||
this.enable = ko.observable(undefined === this.enable ? true : !!this.enable);
|
||||
}
|
||||
|
||||
this.disable = params.disable;
|
||||
if (isUnd(this.disable) || !this.disable.subscribe) {
|
||||
this.disable = ko.observable(isUnd(this.disable) ? false : !!this.disable);
|
||||
if (undefined === this.disable || !this.disable.subscribe) {
|
||||
this.disable = ko.observable(undefined === this.disable ? false : !!this.disable);
|
||||
}
|
||||
|
||||
this.label = params.label || '';
|
||||
this.inline = isUnd(params.inline) ? false : params.inline;
|
||||
this.inline = undefined === params.inline ? false : params.inline;
|
||||
|
||||
this.readOnly = isUnd(params.readOnly) ? false : !!params.readOnly;
|
||||
this.inverted = isUnd(params.inverted) ? false : !!params.inverted;
|
||||
this.readOnly = undefined === params.readOnly ? false : !!params.readOnly;
|
||||
this.inverted = undefined === params.inverted ? false : !!params.inverted;
|
||||
|
||||
this.labeled = !isUnd(params.label);
|
||||
this.labeled = undefined !== params.label;
|
||||
this.labelAnimated = !!params.labelAnimated;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user