Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohann-S <johann.servoire@gmail.com>2017-11-13 13:25:36 +0300
committerGitHub <noreply@github.com>2017-11-13 13:25:36 +0300
commit9a0bba9afa039308e84442a2b329bf64f5678a00 (patch)
tree0b4216889b0b675407b85d74692d8505ecfd0c82 /js/src/modal.js
parent1354a929f911bfb8bf3a9b22c0f79fc0277c3a74 (diff)
Object spread : less jQuery more ES6 (#24665)
Diffstat (limited to 'js/src/modal.js')
-rw-r--r--js/src/modal.js21
1 files changed, 13 insertions, 8 deletions
diff --git a/js/src/modal.js b/js/src/modal.js
index 95565aabcc..be3105fa15 100644
--- a/js/src/modal.js
+++ b/js/src/modal.js
@@ -227,7 +227,10 @@ const Modal = (($) => {
// private
_getConfig(config) {
- config = $.extend({}, Default, config)
+ config = {
+ ...Default,
+ ...config
+ }
Util.typeCheckConfig(NAME, config, DefaultType)
return config
}
@@ -506,12 +509,11 @@ const Modal = (($) => {
static _jQueryInterface(config, relatedTarget) {
return this.each(function () {
let data = $(this).data(DATA_KEY)
- const _config = $.extend(
- {},
- Modal.Default,
- $(this).data(),
- typeof config === 'object' && config
- )
+ const _config = {
+ ...Modal.Default,
+ ...$(this).data(),
+ ...typeof config === 'object' && config
+ }
if (!data) {
data = new Modal(this, _config)
@@ -547,7 +549,10 @@ const Modal = (($) => {
}
const config = $(target).data(DATA_KEY) ?
- 'toggle' : $.extend({}, $(target).data(), $(this).data())
+ 'toggle' : {
+ ...$(target).data(),
+ ...$(this).data()
+ }
if (this.tagName === 'A' || this.tagName === 'AREA') {
event.preventDefault()