mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 12:09:20 +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,66 +0,0 @@
|
|||
|
||||
(function () {
|
||||
|
||||
'use strict';
|
||||
|
||||
var
|
||||
_ = require('_'),
|
||||
ko = require('ko'),
|
||||
|
||||
AbstracCheckbox = require('Component/AbstracCheckbox')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*
|
||||
* @param {Object} oParams
|
||||
*
|
||||
* @extends AbstracCheckbox
|
||||
*/
|
||||
function CheckboxMaterialDesignComponent(oParams)
|
||||
{
|
||||
AbstracCheckbox.call(this, oParams);
|
||||
|
||||
this.animationBox = ko.observable(false).extend({'falseTimeout': 200});
|
||||
this.animationCheckmark = ko.observable(false).extend({'falseTimeout': 200});
|
||||
|
||||
this.animationBoxSetTrue = _.bind(this.animationBoxSetTrue, this);
|
||||
this.animationCheckmarkSetTrue = _.bind(this.animationCheckmarkSetTrue, this);
|
||||
|
||||
this.disposable.push(
|
||||
this.value.subscribe(function (bValue) {
|
||||
this.triggerAnimation(bValue);
|
||||
}, this)
|
||||
);
|
||||
}
|
||||
|
||||
_.extend(CheckboxMaterialDesignComponent.prototype, AbstracCheckbox.prototype);
|
||||
|
||||
CheckboxMaterialDesignComponent.prototype.animationBoxSetTrue = function()
|
||||
{
|
||||
this.animationBox(true);
|
||||
};
|
||||
|
||||
CheckboxMaterialDesignComponent.prototype.animationCheckmarkSetTrue = function()
|
||||
{
|
||||
this.animationCheckmark(true);
|
||||
};
|
||||
|
||||
CheckboxMaterialDesignComponent.prototype.triggerAnimation = function(bBox)
|
||||
{
|
||||
if (bBox)
|
||||
{
|
||||
this.animationBoxSetTrue();
|
||||
_.delay(this.animationCheckmarkSetTrue, 200);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.animationCheckmarkSetTrue();
|
||||
_.delay(this.animationBoxSetTrue, 200);
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = AbstracCheckbox.componentExportHelper(
|
||||
CheckboxMaterialDesignComponent, 'CheckboxMaterialDesignComponent');
|
||||
|
||||
}());
|
||||
48
dev/Component/MaterialDesign/Checkbox.jsx
Normal file
48
dev/Component/MaterialDesign/Checkbox.jsx
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
|
||||
import {_} from 'common';
|
||||
import ko from 'ko';
|
||||
import {componentExportHelper} from 'Component/Abstract';
|
||||
import {AbstracCheckbox} from 'Component/AbstracCheckbox';
|
||||
|
||||
class CheckboxMaterialDesignComponent extends AbstracCheckbox
|
||||
{
|
||||
/**
|
||||
* @param {Object} params
|
||||
*/
|
||||
constructor(params) {
|
||||
|
||||
super(params);
|
||||
|
||||
this.animationBox = ko.observable(false).extend({'falseTimeout': 200});
|
||||
this.animationCheckmark = ko.observable(false).extend({'falseTimeout': 200});
|
||||
|
||||
this.animationBoxSetTrue = _.bind(this.animationBoxSetTrue, this);
|
||||
this.animationCheckmarkSetTrue = _.bind(this.animationCheckmarkSetTrue, this);
|
||||
|
||||
this.disposable.push(
|
||||
this.value.subscribe((value) => {
|
||||
this.triggerAnimation(value);
|
||||
}, this)
|
||||
);
|
||||
}
|
||||
|
||||
animationBoxSetTrue() {
|
||||
this.animationBox(true);
|
||||
}
|
||||
|
||||
animationCheckmarkSetTrue() {
|
||||
this.animationCheckmark(true);
|
||||
}
|
||||
|
||||
triggerAnimation(box) {
|
||||
if (box) {
|
||||
this.animationBoxSetTrue();
|
||||
_.delay(this.animationCheckmarkSetTrue, 200);
|
||||
} else {
|
||||
this.animationCheckmarkSetTrue();
|
||||
_.delay(this.animationBoxSetTrue, 200);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = componentExportHelper(CheckboxMaterialDesignComponent, 'CheckboxMaterialDesignComponent');
|
||||
Loading…
Add table
Add a link
Reference in a new issue