mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 20:19:22 +03:00
ES2015 first look / babeljs
This commit is contained in:
parent
5dcceaaca5
commit
445cd155e5
123 changed files with 3214 additions and 3680 deletions
|
|
@ -1,68 +0,0 @@
|
|||
|
||||
(function () {
|
||||
|
||||
'use strict';
|
||||
|
||||
var
|
||||
_ = require('_'),
|
||||
ko = require('ko'),
|
||||
|
||||
Utils = require('Common/Utils'),
|
||||
|
||||
AbstractComponent = require('Component/Abstract')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*
|
||||
* @param {Object} oParams
|
||||
*
|
||||
* @extends AbstractComponent
|
||||
*/
|
||||
function AbstracCheckbox(oParams)
|
||||
{
|
||||
AbstractComponent.call(this);
|
||||
|
||||
this.value = oParams.value;
|
||||
if (Utils.isUnd(this.value) || !this.value.subscribe)
|
||||
{
|
||||
this.value = ko.observable(Utils.isUnd(this.value) ? false : !!this.value);
|
||||
}
|
||||
|
||||
this.enable = oParams.enable;
|
||||
if (Utils.isUnd(this.enable) || !this.enable.subscribe)
|
||||
{
|
||||
this.enable = ko.observable(Utils.isUnd(this.enable) ? true : !!this.enable);
|
||||
}
|
||||
|
||||
this.disable = oParams.disable;
|
||||
if (Utils.isUnd(this.disable) || !this.disable.subscribe)
|
||||
{
|
||||
this.disable = ko.observable(Utils.isUnd(this.disable) ? false : !!this.disable);
|
||||
}
|
||||
|
||||
this.label = oParams.label || '';
|
||||
this.inline = Utils.isUnd(oParams.inline) ? false : oParams.inline;
|
||||
|
||||
this.readOnly = Utils.isUnd(oParams.readOnly) ? false : !!oParams.readOnly;
|
||||
this.inverted = Utils.isUnd(oParams.inverted) ? false : !!oParams.inverted;
|
||||
|
||||
this.labeled = !Utils.isUnd(oParams.label);
|
||||
this.labelAnimated = !!oParams.labelAnimated;
|
||||
}
|
||||
|
||||
_.extend(AbstracCheckbox.prototype, AbstractComponent.prototype);
|
||||
|
||||
AbstracCheckbox.prototype.click = function()
|
||||
{
|
||||
if (!this.readOnly && this.enable() && !this.disable())
|
||||
{
|
||||
this.value(!this.value());
|
||||
}
|
||||
};
|
||||
|
||||
AbstracCheckbox.componentExportHelper = AbstractComponent.componentExportHelper;
|
||||
|
||||
module.exports = AbstracCheckbox;
|
||||
|
||||
}());
|
||||
Loading…
Add table
Add a link
Reference in a new issue