From 9a0bba9afa039308e84442a2b329bf64f5678a00 Mon Sep 17 00:00:00 2001 From: Johann-S Date: Mon, 13 Nov 2017 11:25:36 +0100 Subject: Object spread : less jQuery more ES6 (#24665) --- js/src/dropdown.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'js/src/dropdown.js') diff --git a/js/src/dropdown.js b/js/src/dropdown.js index 57ee10ebd..8affedc6c 100644 --- a/js/src/dropdown.js +++ b/js/src/dropdown.js @@ -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 { -- cgit v1.2.3