mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-06-26 16:26:44 +03:00
Better (material) components design
This commit is contained in:
parent
30bec04a75
commit
a92d5a0f4f
10 changed files with 48 additions and 122 deletions
|
|
@ -1,28 +1,3 @@
|
|||
import ko from 'ko';
|
||||
import { AbstractCheckbox } from 'Component/AbstractCheckbox';
|
||||
|
||||
export class CheckboxMaterialDesignComponent extends AbstractCheckbox {
|
||||
/**
|
||||
* @param {Object} params
|
||||
*/
|
||||
constructor(params) {
|
||||
super(params);
|
||||
|
||||
this.animationBox = ko.observable(false).extend({ falseTimeout: 200 });
|
||||
this.animationCheckmark = ko.observable(false).extend({ falseTimeout: 200 });
|
||||
|
||||
this.disposable.push(
|
||||
this.value.subscribe(value => this.triggerAnimation(value), this)
|
||||
);
|
||||
}
|
||||
|
||||
triggerAnimation(box) {
|
||||
if (box) {
|
||||
this.animationBox(true);
|
||||
setTimeout(()=>this.animationCheckmark(true), 200);
|
||||
} else {
|
||||
this.animationCheckmark(true);
|
||||
setTimeout(()=>this.animationBox(true), 200);
|
||||
}
|
||||
}
|
||||
}
|
||||
export class CheckboxMaterialDesignComponent extends AbstractCheckbox {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue