mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 12:09:20 +03:00
Bugfix and cleanup rollup based javascript even more
This commit is contained in:
parent
7ccc44616d
commit
3983932bc0
17 changed files with 84 additions and 169 deletions
|
|
@ -1,8 +1,5 @@
|
|||
import ko from 'ko';
|
||||
|
||||
import { i18nToNodes } from 'Common/Translator';
|
||||
|
||||
class AbstractComponent {
|
||||
export class AbstractComponent {
|
||||
disposable = [];
|
||||
|
||||
dispose() {
|
||||
|
|
@ -13,33 +10,3 @@ class AbstractComponent {
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {*} ClassObject
|
||||
* @param {string} templateID = ''
|
||||
* @returns {Object}
|
||||
*/
|
||||
const componentExportHelper = (ClassObject, templateID = '') => ({
|
||||
template: templateID ? { element: templateID } : '<b></b>',
|
||||
viewModel: {
|
||||
createViewModel: (params, componentInfo) => {
|
||||
params = params || {};
|
||||
params.element = null;
|
||||
|
||||
if (componentInfo && componentInfo.element) {
|
||||
params.component = componentInfo;
|
||||
params.element = componentInfo.element;
|
||||
|
||||
i18nToNodes(componentInfo.element);
|
||||
|
||||
if (undefined !== params.inline && ko.unwrap(params.inline)) {
|
||||
params.element.style.display = 'inline-block';
|
||||
}
|
||||
}
|
||||
|
||||
return new ClassObject(params);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
export { AbstractComponent, componentExportHelper };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue