mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Removed CheckboxSimple component (was only used at login)
This commit is contained in:
parent
976b1d54bd
commit
456f304338
8 changed files with 38 additions and 61 deletions
|
|
@ -11,7 +11,6 @@ import { ThemeStore } from 'Stores/Theme';
|
||||||
import { InputComponent } from 'Component/Input';
|
import { InputComponent } from 'Component/Input';
|
||||||
import { SelectComponent } from 'Component/Select';
|
import { SelectComponent } from 'Component/Select';
|
||||||
import { CheckboxMaterialDesignComponent } from 'Component/MaterialDesign/Checkbox';
|
import { CheckboxMaterialDesignComponent } from 'Component/MaterialDesign/Checkbox';
|
||||||
import { CheckboxComponent } from 'Component/Checkbox';
|
|
||||||
|
|
||||||
export class AbstractApp {
|
export class AbstractApp {
|
||||||
/**
|
/**
|
||||||
|
|
@ -49,7 +48,6 @@ export class AbstractApp {
|
||||||
register('Input', InputComponent);
|
register('Input', InputComponent);
|
||||||
register('Select', SelectComponent);
|
register('Select', SelectComponent);
|
||||||
register('Checkbox', CheckboxMaterialDesignComponent, 'CheckboxMaterialDesignComponent');
|
register('Checkbox', CheckboxMaterialDesignComponent, 'CheckboxMaterialDesignComponent');
|
||||||
register('CheckboxSimple', CheckboxComponent, 'CheckboxComponent');
|
|
||||||
|
|
||||||
initOnStartOrLangChange();
|
initOnStartOrLangChange();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,23 +0,0 @@
|
||||||
import ko from 'ko';
|
|
||||||
|
|
||||||
export class AbstractCheckbox {
|
|
||||||
/**
|
|
||||||
* @param {Object} params = {}
|
|
||||||
*/
|
|
||||||
constructor(params = {}) {
|
|
||||||
this.value = ko.isObservable(params.value) ? params.value
|
|
||||||
: ko.observable(!!params.value);
|
|
||||||
|
|
||||||
this.enable = ko.isObservable(params.enable) ? params.enable
|
|
||||||
: ko.observable(undefined === params.enable || !!params.enable);
|
|
||||||
|
|
||||||
this.label = params.label || '';
|
|
||||||
this.inline = !!params.inline;
|
|
||||||
|
|
||||||
this.labeled = undefined !== params.label;
|
|
||||||
}
|
|
||||||
|
|
||||||
click() {
|
|
||||||
this.enable() && this.value(!this.value());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
import { AbstractCheckbox } from 'Component/AbstractCheckbox';
|
|
||||||
|
|
||||||
export class CheckboxComponent extends AbstractCheckbox {}
|
|
||||||
|
|
@ -1,3 +1,18 @@
|
||||||
import { AbstractCheckbox } from 'Component/AbstractCheckbox';
|
export class CheckboxMaterialDesignComponent {
|
||||||
|
constructor(params = {}) {
|
||||||
|
this.value = ko.isObservable(params.value) ? params.value
|
||||||
|
: ko.observable(!!params.value);
|
||||||
|
|
||||||
export class CheckboxMaterialDesignComponent extends AbstractCheckbox {}
|
this.enable = ko.isObservable(params.enable) ? params.enable
|
||||||
|
: ko.observable(undefined === params.enable || !!params.enable);
|
||||||
|
|
||||||
|
this.label = params.label;
|
||||||
|
this.inline = params.inline;
|
||||||
|
|
||||||
|
this.labeled = null != params.label;
|
||||||
|
}
|
||||||
|
|
||||||
|
click() {
|
||||||
|
this.enable() && this.value(!this.value());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,18 @@
|
||||||
outline: 1px dotted;
|
outline: 1px dotted;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.e-checkbox {
|
span {
|
||||||
|
margin-left: 0.5em;
|
||||||
|
white-space: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
select + span {
|
||||||
|
line-height: 1.43em;
|
||||||
|
padding: 4px 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.e-checkbox {
|
||||||
|
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
margin-bottom: 6px;
|
margin-bottom: 6px;
|
||||||
|
|
@ -56,17 +67,6 @@
|
||||||
cursor: not-allowed;
|
cursor: not-allowed;
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
span {
|
|
||||||
margin-left: 0.5em;
|
|
||||||
white-space: normal;
|
|
||||||
}
|
|
||||||
|
|
||||||
select + span {
|
|
||||||
line-height: 1.43em;
|
|
||||||
padding: 4px 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.e-checkbox.material-design {
|
.e-checkbox.material-design {
|
||||||
|
|
|
||||||
|
|
@ -135,7 +135,6 @@
|
||||||
|
|
||||||
.language-buttons {
|
.language-buttons {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
margin-top: 5px;
|
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
<div class="e-component e-checkbox" tabindex="0" data-bind="click: click, onSpace: click, css: { 'disabled': !enable() }">
|
|
||||||
<i role="checkbox" class="e-checkbox-icon fontastic" data-bind="text: value() ? '☑' : '☐'"></i>
|
|
||||||
<!-- ko if: labeled -->
|
|
||||||
<span data-bind="attr: {'data-i18n': label}"></span>
|
|
||||||
<!-- /ko -->
|
|
||||||
</div>
|
|
||||||
|
|
@ -25,13 +25,10 @@
|
||||||
</div>
|
</div>
|
||||||
<div id="plugin-Login-BottomControlGroup"></div>
|
<div id="plugin-Login-BottomControlGroup"></div>
|
||||||
<div class="controls" style="display: flex">
|
<div class="controls" style="display: flex">
|
||||||
<div class="signMeLabel" data-bind="visible: signMeVisibility, component: {
|
<div class="e-checkbox" tabindex="0" data-bind="click: function(){signMe(!signMe())}, onSpace: function(){signMe(!signMe())}">
|
||||||
name: 'CheckboxSimple',
|
<i role="checkbox" class="fontastic" data-bind="text: signMe() ? '☑' : '☐'"></i>
|
||||||
params: {
|
<span data-i18n="LOGIN/LABEL_SIGN_ME"></span>
|
||||||
label: 'LOGIN/LABEL_SIGN_ME',
|
</div>
|
||||||
value: signMe
|
|
||||||
}
|
|
||||||
}"></div>
|
|
||||||
<div class="language-buttons">
|
<div class="language-buttons">
|
||||||
<a href="#" class="language-button fontastic"
|
<a href="#" class="language-button fontastic"
|
||||||
data-bind="visible: allowLanguagesOnLogin, click: selectLanguage, css: { 'icon-spinner' : langRequest }"
|
data-bind="visible: allowLanguagesOnLogin, click: selectLanguage, css: { 'icon-spinner' : langRequest }"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue