refactor(view) showImage: assign -> spread

This commit is contained in:
coderaiser 2018-04-16 10:20:30 +03:00
parent cf4a273e83
commit cb0494d2dc
4 changed files with 14 additions and 4 deletions

View file

@ -3,7 +3,8 @@
"env"
],
"plugins": [
"transform-object-assign"
"transform-object-assign",
"transform-object-rest-spread"
]
}

View file

@ -5,7 +5,10 @@
},
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
"sourceType": "module",
"ecmaFeatures": {
"experimentalObjectRestSpread": true
}
},
"rules": {
"indent": ["error", 4],

View file

@ -219,7 +219,7 @@ function showImage(href, prefixUrl) {
.map(makeTitle);
const index = names.indexOf(Info.path);
const config = Object.assign({}, Config, {
const imageConfig = {
index,
autoSize : true,
type : 'image',
@ -231,7 +231,12 @@ function showImage(href, prefixUrl) {
overlay : null,
title : {}
}
});
};
const config = {
...Config,
...imageConfig,
};
$.fancybox.open(titles, config);
}

View file

@ -159,6 +159,7 @@
"babel-cli": "^6.18.0",
"babel-loader": "^7.0.0",
"babel-plugin-transform-object-assign": "^6.22.0",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-preset-env": "^1.6.0",
"clean-css-loader": "^0.1.2",
"clear-module": "^2.1.0",