mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-31 21:19:21 +03:00
Add more strict rules (eslint)
This commit is contained in:
parent
b43bb17cdb
commit
52e2698cdf
38 changed files with 488 additions and 434 deletions
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
import {_} from 'common';
|
||||
import _ from '_';
|
||||
import ko from 'ko';
|
||||
import {isUnd} from 'Common/Utils';
|
||||
import {AbstractComponent} from 'Component/Abstract';
|
||||
|
|
@ -27,9 +27,7 @@ class AbstracRadio extends AbstractComponent
|
|||
|
||||
if (params.values)
|
||||
{
|
||||
this.values(_.map(params.values, (label, value) => {
|
||||
return {label: label, value: value};
|
||||
}));
|
||||
this.values(_.map(params.values, (label, value) => ({label: label, value: value})));
|
||||
}
|
||||
|
||||
this.click = _.bind(this.click, this);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
import {$} from 'common';
|
||||
import {isUnd} from 'Common/Utils';
|
||||
import $ from '$';
|
||||
import ko from 'ko';
|
||||
import {isUnd} from 'Common/Utils';
|
||||
|
||||
class AbstractComponent
|
||||
{
|
||||
|
|
@ -24,32 +24,30 @@ class AbstractComponent
|
|||
* @param {string} templateID = ''
|
||||
* @returns {Object}
|
||||
*/
|
||||
const componentExportHelper = (ClassObject, templateID = '') => {
|
||||
return {
|
||||
template: templateID ? {element: templateID} : '<b></b>',
|
||||
viewModel: {
|
||||
createViewModel: (params, componentInfo) => {
|
||||
const componentExportHelper = (ClassObject, templateID = '') => ({
|
||||
template: templateID ? {element: templateID} : '<b></b>',
|
||||
viewModel: {
|
||||
createViewModel: (params, componentInfo) => {
|
||||
|
||||
params = params || {};
|
||||
params.element = null;
|
||||
params = params || {};
|
||||
params.element = null;
|
||||
|
||||
if (componentInfo && componentInfo.element)
|
||||
if (componentInfo && componentInfo.element)
|
||||
{
|
||||
params.component = componentInfo;
|
||||
params.element = $(componentInfo.element);
|
||||
|
||||
require('Common/Translator').i18nToNodes(params.element);
|
||||
|
||||
if (!isUnd(params.inline) && ko.unwrap(params.inline))
|
||||
{
|
||||
params.component = componentInfo;
|
||||
params.element = $(componentInfo.element);
|
||||
|
||||
require('Common/Translator').i18nToNodes(params.element);
|
||||
|
||||
if (!isUnd(params.inline) && ko.unwrap(params.inline))
|
||||
{
|
||||
params.element.css('display', 'inline-block');
|
||||
}
|
||||
params.element.css('display', 'inline-block');
|
||||
}
|
||||
|
||||
return new ClassObject(params);
|
||||
}
|
||||
|
||||
return new ClassObject(params);
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
export {AbstractComponent, componentExportHelper};
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
import {_} from 'common';
|
||||
import _ from '_';
|
||||
import ko from 'ko';
|
||||
import {componentExportHelper} from 'Component/Abstract';
|
||||
import {AbstracCheckbox} from 'Component/AbstracCheckbox';
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
import {$} from 'common';
|
||||
import $ from '$';
|
||||
import {AbstractComponent, componentExportHelper} from 'Component/Abstract';
|
||||
|
||||
class ScriptComponent extends AbstractComponent
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
import {$} from 'common';
|
||||
import $ from '$';
|
||||
|
||||
let cachedUrl = null;
|
||||
const getUrl = () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue