mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 20:19:22 +03:00
*.jsx -> *.js
This commit is contained in:
parent
0a2b826f71
commit
e88c193334
98 changed files with 341 additions and 340 deletions
50
dev/Component/MaterialDesign/Checkbox.js
Normal file
50
dev/Component/MaterialDesign/Checkbox.js
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
|
||||
import _ from '_';
|
||||
import ko from 'ko';
|
||||
import {componentExportHelper} from 'Component/Abstract';
|
||||
import {AbstracCheckbox} from 'Component/AbstracCheckbox';
|
||||
|
||||
class CheckboxMaterialDesignComponent extends AbstracCheckbox
|
||||
{
|
||||
/**
|
||||
* @constructor
|
||||
* @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