diff --git a/.babelrc b/.babelrc index 29d84f88..66948953 100644 --- a/.babelrc +++ b/.babelrc @@ -3,7 +3,8 @@ "env" ], "plugins": [ - "transform-object-assign" + "transform-object-assign", + "transform-object-rest-spread" ] } diff --git a/.eslintrc b/.eslintrc index bbba244c..b7423806 100644 --- a/.eslintrc +++ b/.eslintrc @@ -5,7 +5,10 @@ }, "parserOptions": { "ecmaVersion": 6, - "sourceType": "module" + "sourceType": "module", + "ecmaFeatures": { + "experimentalObjectRestSpread": true + } }, "rules": { "indent": ["error", 4], diff --git a/client/modules/view.js b/client/modules/view.js index 65999ccd..3b1462a1 100644 --- a/client/modules/view.js +++ b/client/modules/view.js @@ -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); } diff --git a/package.json b/package.json index 1d0c04c9..b430bf3e 100644 --- a/package.json +++ b/package.json @@ -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",