2
0
mirror of https://github.com/tenrok/bootstrap.git synced 2026-06-05 16:42:29 +03:00

Object spread : less jQuery more ES6 (#24665)

This commit is contained in:
Johann-S
2017-11-13 11:25:36 +01:00
committed by GitHub
parent 1354a929f9
commit 9a0bba9afa
9 changed files with 85 additions and 51 deletions
+9 -7
View File
@@ -210,12 +210,11 @@ const Dropdown = (($) => {
}
_getConfig(config) {
config = $.extend(
{},
this.constructor.Default,
$(this._element).data(),
config
)
config = {
...this.constructor.Default,
...$(this._element).data(),
...config
}
Util.typeCheckConfig(
NAME,
@@ -262,7 +261,10 @@ const Dropdown = (($) => {
const offsetConf = {}
if (typeof this._config.offset === 'function') {
offsetConf.fn = (data) => {
data.offsets = $.extend({}, data.offsets, this._config.offset(data.offsets) || {})
data.offsets = {
...data.offsets,
...this._config.offset(data.offsets) || {}
}
return data
}
} else {