refactor(edit) initConfig: default parameters

This commit is contained in:
coderaiser 2017-02-17 15:57:48 +02:00
parent 5fbbb114c8
commit 1aaf9e63ec

View file

@ -59,16 +59,13 @@ function EditProto(callback) {
throw Error(name + ' should be a function!');
}
function initConfig(config = {}, options) {
Object.assign(config, ConfigView);
if (!options)
return config;
function initConfig(options = {}) {
const config = Object.assign({}, options, ConfigView);
if (options.afterShow) {
checkFn('options.afterShow', options.afterShow);
const afterShow = config.afterShow;
const afterShow = {config};
config.afterShow = () => {
afterShow();