diff options
| author | Johann-S <[email protected]> | 2017-11-13 11:25:36 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2017-11-13 11:25:36 +0100 |
| commit | 9a0bba9afa039308e84442a2b329bf64f5678a00 (patch) | |
| tree | 0b4216889b0b675407b85d74692d8505ecfd0c82 /js/src/carousel.js | |
| parent | 1354a929f911bfb8bf3a9b22c0f79fc0277c3a74 (diff) | |
| download | bootstrap-9a0bba9afa039308e84442a2b329bf64f5678a00.tar.xz bootstrap-9a0bba9afa039308e84442a2b329bf64f5678a00.zip | |
Object spread : less jQuery more ES6 (#24665)
Diffstat (limited to 'js/src/carousel.js')
| -rw-r--r-- | js/src/carousel.js | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/js/src/carousel.js b/js/src/carousel.js index 10ed2203e..ea443f189 100644 --- a/js/src/carousel.js +++ b/js/src/carousel.js @@ -223,7 +223,10 @@ const Carousel = (($) => { // private _getConfig(config) { - config = $.extend({}, Default, config) + config = { + ...Default, + ...config + } Util.typeCheckConfig(NAME, config, DefaultType) return config } @@ -428,10 +431,16 @@ const Carousel = (($) => { static _jQueryInterface(config) { return this.each(function () { let data = $(this).data(DATA_KEY) - const _config = $.extend({}, Default, $(this).data()) + let _config = { + ...Default, + ...$(this).data() + } if (typeof config === 'object') { - $.extend(_config, config) + _config = { + ..._config, + ...config + } } const action = typeof config === 'string' ? config : _config.slide @@ -468,7 +477,10 @@ const Carousel = (($) => { return } - const config = $.extend({}, $(target).data(), $(this).data()) + const config = { + ...$(target).data(), + ...$(this).data() + } const slideIndex = this.getAttribute('data-slide-to') if (slideIndex) { |
