fix(view) init config: copy

This commit is contained in:
coderaiser 2020-08-11 01:11:08 +03:00
parent 50e0152ced
commit 27df34f000
2 changed files with 8 additions and 0 deletions

View file

@ -69,11 +69,13 @@ async function show() {
const button = createElement('button', {
className: 'cloudcmd-user-menu-button',
innerText: 'User Menu',
notAppend: true,
});
const select = createElement('select', {
className: 'cloudcmd-user-menu',
innerHTML: fillTemplate(names),
notAppend: true,
size: 10,
});

View file

@ -23,7 +23,9 @@ const Images = require('../dom/images');
const {encode} = require('../../common/entity');
const {assign} = Object;
const {isArray} = Array;
const testRegExp = currify((name, reg) => reg.test(name));
const lifo = currify((fn, el, cb, name) => fn(name, el, cb));
@ -184,7 +186,11 @@ function viewFile() {
});
}
const copy = (a) => assign({}, a);
function initConfig(config, options) {
config = copy(config);
if (!options)
return config;