mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-01 13:39: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,65 +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 AbstracRadio(oParams)
|
||||
{
|
||||
AbstractComponent.call(this);
|
||||
|
||||
this.values = ko.observableArray([]);
|
||||
|
||||
this.value = oParams.value;
|
||||
if (Utils.isUnd(this.value) || !this.value.subscribe)
|
||||
{
|
||||
this.value = ko.observable('');
|
||||
}
|
||||
|
||||
this.inline = Utils.isUnd(oParams.inline) ? false : oParams.inline;
|
||||
this.readOnly = Utils.isUnd(oParams.readOnly) ? false : !!oParams.readOnly;
|
||||
|
||||
if (oParams.values)
|
||||
{
|
||||
var aValues = _.map(oParams.values, function (sLabel, sValue) {
|
||||
return {
|
||||
'label': sLabel,
|
||||
'value': sValue
|
||||
};
|
||||
});
|
||||
|
||||
this.values(aValues);
|
||||
}
|
||||
|
||||
this.click = _.bind(this.click, this);
|
||||
}
|
||||
|
||||
AbstracRadio.prototype.click = function(oValue) {
|
||||
if (!this.readOnly && oValue)
|
||||
{
|
||||
this.value(oValue.value);
|
||||
}
|
||||
};
|
||||
|
||||
_.extend(AbstracRadio.prototype, AbstractComponent.prototype);
|
||||
|
||||
AbstracRadio.componentExportHelper = AbstractComponent.componentExportHelper;
|
||||
|
||||
module.exports = AbstracRadio;
|
||||
|
||||
}());
|
||||
Loading…
Add table
Add a link
Reference in a new issue