@openeuropa/bcl-bootstrap 0.24.1 → 0.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. package/bootstrap-icons.svg +1 -1
  2. package/icons/apple.svg +2 -2
  3. package/icons/boombox-fill.svg +2 -2
  4. package/icons/cup-fill.svg +1 -1
  5. package/icons/cup.svg +1 -1
  6. package/js/dist/alert.js +3 -12
  7. package/js/dist/alert.js.map +1 -1
  8. package/js/dist/base-component.js +32 -18
  9. package/js/dist/base-component.js.map +1 -1
  10. package/js/dist/button.js +3 -12
  11. package/js/dist/button.js.map +1 -1
  12. package/js/dist/carousel.js +207 -307
  13. package/js/dist/carousel.js.map +1 -1
  14. package/js/dist/collapse.js +57 -88
  15. package/js/dist/collapse.js.map +1 -1
  16. package/js/dist/dom/data.js +1 -3
  17. package/js/dist/dom/data.js.map +1 -1
  18. package/js/dist/dom/event-handler.js +87 -106
  19. package/js/dist/dom/event-handler.js.map +1 -1
  20. package/js/dist/dom/manipulator.js +21 -25
  21. package/js/dist/dom/manipulator.js.map +1 -1
  22. package/js/dist/dom/selector-engine.js +11 -10
  23. package/js/dist/dom/selector-engine.js.map +1 -1
  24. package/js/dist/dropdown.js +83 -115
  25. package/js/dist/dropdown.js.map +1 -1
  26. package/js/dist/modal.js +95 -152
  27. package/js/dist/modal.js.map +1 -1
  28. package/js/dist/offcanvas.js +75 -58
  29. package/js/dist/offcanvas.js.map +1 -1
  30. package/js/dist/popover.js +29 -56
  31. package/js/dist/popover.js.map +1 -1
  32. package/js/dist/scrollspy.js +176 -125
  33. package/js/dist/scrollspy.js.map +1 -1
  34. package/js/dist/tab.js +207 -92
  35. package/js/dist/tab.js.map +1 -1
  36. package/js/dist/toast.js +23 -37
  37. package/js/dist/toast.js.map +1 -1
  38. package/js/dist/tooltip.js +259 -348
  39. package/js/dist/tooltip.js.map +1 -1
  40. package/js/dist/util/backdrop.js +62 -39
  41. package/js/dist/util/backdrop.js.map +1 -1
  42. package/js/dist/util/component-functions.js +1 -1
  43. package/js/dist/util/component-functions.js.map +1 -1
  44. package/js/dist/util/config.js +75 -0
  45. package/js/dist/util/config.js.map +1 -0
  46. package/js/dist/util/focustrap.js +41 -34
  47. package/js/dist/util/focustrap.js.map +1 -1
  48. package/js/dist/util/index.js +56 -52
  49. package/js/dist/util/index.js.map +1 -1
  50. package/js/dist/util/sanitizer.js +12 -19
  51. package/js/dist/util/sanitizer.js.map +1 -1
  52. package/js/dist/util/scrollbar.js +49 -34
  53. package/js/dist/util/scrollbar.js.map +1 -1
  54. package/js/dist/util/swipe.js +151 -0
  55. package/js/dist/util/swipe.js.map +1 -0
  56. package/js/dist/util/template-factory.js +173 -0
  57. package/js/dist/util/template-factory.js.map +1 -0
  58. package/js/src/alert.js +3 -15
  59. package/js/src/base-component.js +28 -18
  60. package/js/src/button.js +3 -17
  61. package/js/src/carousel.js +203 -319
  62. package/js/src/collapse.js +61 -94
  63. package/js/src/dom/data.js +1 -3
  64. package/js/src/dom/event-handler.js +80 -108
  65. package/js/src/dom/manipulator.js +22 -31
  66. package/js/src/dom/selector-engine.js +10 -19
  67. package/js/src/dropdown.js +84 -138
  68. package/js/src/modal.js +94 -158
  69. package/js/src/offcanvas.js +72 -61
  70. package/js/src/popover.js +31 -62
  71. package/js/src/scrollspy.js +166 -171
  72. package/js/src/tab.js +193 -110
  73. package/js/src/toast.js +19 -41
  74. package/js/src/tooltip.js +259 -371
  75. package/js/src/util/backdrop.js +55 -36
  76. package/js/src/util/component-functions.js +1 -1
  77. package/js/src/util/config.js +66 -0
  78. package/js/src/util/focustrap.js +38 -28
  79. package/js/src/util/index.js +67 -64
  80. package/js/src/util/sanitizer.js +11 -19
  81. package/js/src/util/scrollbar.js +47 -30
  82. package/js/src/util/swipe.js +146 -0
  83. package/js/src/util/template-factory.js +160 -0
  84. package/package.json +4 -4
  85. package/scss/_accordion.scss +52 -24
  86. package/scss/_alert.scss +18 -4
  87. package/scss/_badge.scss +14 -5
  88. package/scss/_breadcrumb.scss +22 -10
  89. package/scss/_button-group.scss +3 -0
  90. package/scss/_buttons.scss +97 -22
  91. package/scss/_card.scss +55 -37
  92. package/scss/_close.scss +1 -1
  93. package/scss/_containers.scss +1 -1
  94. package/scss/_dropdown.scss +83 -75
  95. package/scss/_functions.scss +7 -7
  96. package/scss/_grid.scss +3 -3
  97. package/scss/_helpers.scss +1 -0
  98. package/scss/_list-group.scss +44 -27
  99. package/scss/_maps.scss +54 -0
  100. package/scss/_modal.scss +71 -43
  101. package/scss/_nav.scss +53 -20
  102. package/scss/_navbar.scss +91 -150
  103. package/scss/_offcanvas.scss +119 -59
  104. package/scss/_pagination.scss +66 -21
  105. package/scss/_placeholders.scss +1 -1
  106. package/scss/_popover.scss +90 -52
  107. package/scss/_progress.scss +20 -9
  108. package/scss/_reboot.scss +25 -40
  109. package/scss/_root.scss +40 -21
  110. package/scss/_spinners.scss +38 -22
  111. package/scss/_tables.scss +32 -23
  112. package/scss/_toasts.scss +35 -16
  113. package/scss/_tooltip.scss +61 -56
  114. package/scss/_type.scss +2 -0
  115. package/scss/_utilities.scss +43 -26
  116. package/scss/_variables.scss +113 -121
  117. package/scss/bootstrap-grid.scss +3 -6
  118. package/scss/bootstrap-reboot.scss +3 -7
  119. package/scss/bootstrap-utilities.scss +3 -6
  120. package/scss/bootstrap.scss +4 -6
  121. package/scss/forms/_floating-labels.scss +14 -3
  122. package/scss/forms/_form-check.scss +28 -5
  123. package/scss/forms/_form-control.scss +12 -37
  124. package/scss/forms/_form-select.scss +0 -1
  125. package/scss/forms/_input-group.scss +15 -7
  126. package/scss/helpers/_color-bg.scss +10 -0
  127. package/scss/helpers/_colored-links.scss +2 -2
  128. package/scss/helpers/_position.scss +7 -1
  129. package/scss/helpers/_ratio.scss +2 -2
  130. package/scss/helpers/_vr.scss +1 -1
  131. package/scss/mixins/_alert.scss +7 -3
  132. package/scss/mixins/_banner.scss +9 -0
  133. package/scss/mixins/_breakpoints.scss +8 -8
  134. package/scss/mixins/_buttons.scss +32 -95
  135. package/scss/mixins/_container.scss +4 -2
  136. package/scss/mixins/_forms.scss +8 -0
  137. package/scss/mixins/_gradients.scss +1 -1
  138. package/scss/mixins/_grid.scss +12 -12
  139. package/scss/mixins/_pagination.scss +4 -25
  140. package/scss/mixins/_reset-text.scss +1 -1
  141. package/scss/mixins/_table-variants.scss +12 -9
  142. package/scss/mixins/_utilities.scss +12 -4
package/js/src/modal.js CHANGED
@@ -1,20 +1,12 @@
1
1
  /**
2
2
  * --------------------------------------------------------------------------
3
- * Bootstrap (v5.1.3): modal.js
3
+ * Bootstrap (v5.2.0): modal.js
4
4
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5
5
  * --------------------------------------------------------------------------
6
6
  */
7
7
 
8
- import {
9
- defineJQueryPlugin,
10
- getElementFromSelector,
11
- isRTL,
12
- isVisible,
13
- reflow,
14
- typeCheckConfig
15
- } from './util/index'
8
+ import { defineJQueryPlugin, getElementFromSelector, isRTL, isVisible, reflow } from './util/index'
16
9
  import EventHandler from './dom/event-handler'
17
- import Manipulator from './dom/manipulator'
18
10
  import SelectorEngine from './dom/selector-engine'
19
11
  import ScrollBarHelper from './util/scrollbar'
20
12
  import BaseComponent from './base-component'
@@ -23,9 +15,7 @@ import FocusTrap from './util/focustrap'
23
15
  import { enableDismissTrigger } from './util/component-functions'
24
16
 
25
17
  /**
26
- * ------------------------------------------------------------------------
27
18
  * Constants
28
- * ------------------------------------------------------------------------
29
19
  */
30
20
 
31
21
  const NAME = 'modal'
@@ -34,28 +24,14 @@ const EVENT_KEY = `.${DATA_KEY}`
34
24
  const DATA_API_KEY = '.data-api'
35
25
  const ESCAPE_KEY = 'Escape'
36
26
 
37
- const Default = {
38
- backdrop: true,
39
- keyboard: true,
40
- focus: true
41
- }
42
-
43
- const DefaultType = {
44
- backdrop: '(boolean|string)',
45
- keyboard: 'boolean',
46
- focus: 'boolean'
47
- }
48
-
49
27
  const EVENT_HIDE = `hide${EVENT_KEY}`
50
28
  const EVENT_HIDE_PREVENTED = `hidePrevented${EVENT_KEY}`
51
29
  const EVENT_HIDDEN = `hidden${EVENT_KEY}`
52
30
  const EVENT_SHOW = `show${EVENT_KEY}`
53
31
  const EVENT_SHOWN = `shown${EVENT_KEY}`
54
32
  const EVENT_RESIZE = `resize${EVENT_KEY}`
55
- const EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY}`
56
- const EVENT_KEYDOWN_DISMISS = `keydown.dismiss${EVENT_KEY}`
57
- const EVENT_MOUSEUP_DISMISS = `mouseup.dismiss${EVENT_KEY}`
58
33
  const EVENT_MOUSEDOWN_DISMISS = `mousedown.dismiss${EVENT_KEY}`
34
+ const EVENT_KEYDOWN_DISMISS = `keydown.dismiss${EVENT_KEY}`
59
35
  const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`
60
36
 
61
37
  const CLASS_NAME_OPEN = 'modal-open'
@@ -68,38 +44,50 @@ const SELECTOR_DIALOG = '.modal-dialog'
68
44
  const SELECTOR_MODAL_BODY = '.modal-body'
69
45
  const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="modal"]'
70
46
 
47
+ const Default = {
48
+ backdrop: true,
49
+ focus: true,
50
+ keyboard: true
51
+ }
52
+
53
+ const DefaultType = {
54
+ backdrop: '(boolean|string)',
55
+ focus: 'boolean',
56
+ keyboard: 'boolean'
57
+ }
58
+
71
59
  /**
72
- * ------------------------------------------------------------------------
73
- * Class Definition
74
- * ------------------------------------------------------------------------
60
+ * Class definition
75
61
  */
76
62
 
77
63
  class Modal extends BaseComponent {
78
64
  constructor(element, config) {
79
- super(element)
65
+ super(element, config)
80
66
 
81
- this._config = this._getConfig(config)
82
67
  this._dialog = SelectorEngine.findOne(SELECTOR_DIALOG, this._element)
83
68
  this._backdrop = this._initializeBackDrop()
84
69
  this._focustrap = this._initializeFocusTrap()
85
70
  this._isShown = false
86
- this._ignoreBackdropClick = false
87
71
  this._isTransitioning = false
88
72
  this._scrollBar = new ScrollBarHelper()
73
+
74
+ this._addEventListeners()
89
75
  }
90
76
 
91
77
  // Getters
92
-
93
78
  static get Default() {
94
79
  return Default
95
80
  }
96
81
 
82
+ static get DefaultType() {
83
+ return DefaultType
84
+ }
85
+
97
86
  static get NAME() {
98
87
  return NAME
99
88
  }
100
89
 
101
90
  // Public
102
-
103
91
  toggle(relatedTarget) {
104
92
  return this._isShown ? this.hide() : this.show(relatedTarget)
105
93
  }
@@ -118,10 +106,7 @@ class Modal extends BaseComponent {
118
106
  }
119
107
 
120
108
  this._isShown = true
121
-
122
- if (this._isAnimated()) {
123
- this._isTransitioning = true
124
- }
109
+ this._isTransitioning = true
125
110
 
126
111
  this._scrollBar.hide()
127
112
 
@@ -129,18 +114,7 @@ class Modal extends BaseComponent {
129
114
 
130
115
  this._adjustDialog()
131
116
 
132
- this._setEscapeEvent()
133
- this._setResizeEvent()
134
-
135
- EventHandler.on(this._dialog, EVENT_MOUSEDOWN_DISMISS, () => {
136
- EventHandler.one(this._element, EVENT_MOUSEUP_DISMISS, event => {
137
- if (event.target === this._element) {
138
- this._ignoreBackdropClick = true
139
- }
140
- })
141
- })
142
-
143
- this._showBackdrop(() => this._showElement(relatedTarget))
117
+ this._backdrop.show(() => this._showElement(relatedTarget))
144
118
  }
145
119
 
146
120
  hide() {
@@ -155,28 +129,18 @@ class Modal extends BaseComponent {
155
129
  }
156
130
 
157
131
  this._isShown = false
158
- const isAnimated = this._isAnimated()
159
-
160
- if (isAnimated) {
161
- this._isTransitioning = true
162
- }
163
-
164
- this._setEscapeEvent()
165
- this._setResizeEvent()
166
-
132
+ this._isTransitioning = true
167
133
  this._focustrap.deactivate()
168
134
 
169
135
  this._element.classList.remove(CLASS_NAME_SHOW)
170
136
 
171
- EventHandler.off(this._element, EVENT_CLICK_DISMISS)
172
- EventHandler.off(this._dialog, EVENT_MOUSEDOWN_DISMISS)
173
-
174
- this._queueCallback(() => this._hideModal(), this._element, isAnimated)
137
+ this._queueCallback(() => this._hideModal(), this._element, this._isAnimated())
175
138
  }
176
139
 
177
140
  dispose() {
178
- [window, this._dialog]
179
- .forEach(htmlElement => EventHandler.off(htmlElement, EVENT_KEY))
141
+ for (const htmlElement of [window, this._dialog]) {
142
+ EventHandler.off(htmlElement, EVENT_KEY)
143
+ }
180
144
 
181
145
  this._backdrop.dispose()
182
146
  this._focustrap.deactivate()
@@ -188,10 +152,9 @@ class Modal extends BaseComponent {
188
152
  }
189
153
 
190
154
  // Private
191
-
192
155
  _initializeBackDrop() {
193
156
  return new Backdrop({
194
- isVisible: Boolean(this._config.backdrop), // 'static' option will be translated to true, and booleans will keep their value
157
+ isVisible: Boolean(this._config.backdrop), // 'static' option will be translated to true, and booleans will keep their value,
195
158
  isAnimated: this._isAnimated()
196
159
  })
197
160
  }
@@ -202,22 +165,9 @@ class Modal extends BaseComponent {
202
165
  })
203
166
  }
204
167
 
205
- _getConfig(config) {
206
- config = {
207
- ...Default,
208
- ...Manipulator.getDataAttributes(this._element),
209
- ...(typeof config === 'object' ? config : {})
210
- }
211
- typeCheckConfig(NAME, config, DefaultType)
212
- return config
213
- }
214
-
215
168
  _showElement(relatedTarget) {
216
- const isAnimated = this._isAnimated()
217
- const modalBody = SelectorEngine.findOne(SELECTOR_MODAL_BODY, this._dialog)
218
-
219
- if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
220
- // Don't move modal's DOM position
169
+ // try to append dynamic modal
170
+ if (!document.body.contains(this._element)) {
221
171
  document.body.append(this._element)
222
172
  }
223
173
 
@@ -227,13 +177,12 @@ class Modal extends BaseComponent {
227
177
  this._element.setAttribute('role', 'dialog')
228
178
  this._element.scrollTop = 0
229
179
 
180
+ const modalBody = SelectorEngine.findOne(SELECTOR_MODAL_BODY, this._dialog)
230
181
  if (modalBody) {
231
182
  modalBody.scrollTop = 0
232
183
  }
233
184
 
234
- if (isAnimated) {
235
- reflow(this._element)
236
- }
185
+ reflow(this._element)
237
186
 
238
187
  this._element.classList.add(CLASS_NAME_SHOW)
239
188
 
@@ -248,30 +197,44 @@ class Modal extends BaseComponent {
248
197
  })
249
198
  }
250
199
 
251
- this._queueCallback(transitionComplete, this._dialog, isAnimated)
200
+ this._queueCallback(transitionComplete, this._dialog, this._isAnimated())
252
201
  }
253
202
 
254
- _setEscapeEvent() {
255
- if (this._isShown) {
256
- EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS, event => {
257
- if (this._config.keyboard && event.key === ESCAPE_KEY) {
258
- event.preventDefault()
259
- this.hide()
260
- } else if (!this._config.keyboard && event.key === ESCAPE_KEY) {
261
- this._triggerBackdropTransition()
262
- }
263
- })
264
- } else {
265
- EventHandler.off(this._element, EVENT_KEYDOWN_DISMISS)
266
- }
267
- }
203
+ _addEventListeners() {
204
+ EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS, event => {
205
+ if (event.key !== ESCAPE_KEY) {
206
+ return
207
+ }
268
208
 
269
- _setResizeEvent() {
270
- if (this._isShown) {
271
- EventHandler.on(window, EVENT_RESIZE, () => this._adjustDialog())
272
- } else {
273
- EventHandler.off(window, EVENT_RESIZE)
274
- }
209
+ if (this._config.keyboard) {
210
+ event.preventDefault()
211
+ this.hide()
212
+ return
213
+ }
214
+
215
+ this._triggerBackdropTransition()
216
+ })
217
+
218
+ EventHandler.on(window, EVENT_RESIZE, () => {
219
+ if (this._isShown && !this._isTransitioning) {
220
+ this._adjustDialog()
221
+ }
222
+ })
223
+
224
+ EventHandler.on(this._element, EVENT_MOUSEDOWN_DISMISS, event => {
225
+ if (event.target !== event.currentTarget) { // click is inside modal-dialog
226
+ return
227
+ }
228
+
229
+ if (this._config.backdrop === 'static') {
230
+ this._triggerBackdropTransition()
231
+ return
232
+ }
233
+
234
+ if (this._config.backdrop) {
235
+ this.hide()
236
+ }
237
+ })
275
238
  }
276
239
 
277
240
  _hideModal() {
@@ -280,6 +243,7 @@ class Modal extends BaseComponent {
280
243
  this._element.removeAttribute('aria-modal')
281
244
  this._element.removeAttribute('role')
282
245
  this._isTransitioning = false
246
+
283
247
  this._backdrop.hide(() => {
284
248
  document.body.classList.remove(CLASS_NAME_OPEN)
285
249
  this._resetAdjustments()
@@ -288,27 +252,6 @@ class Modal extends BaseComponent {
288
252
  })
289
253
  }
290
254
 
291
- _showBackdrop(callback) {
292
- EventHandler.on(this._element, EVENT_CLICK_DISMISS, event => {
293
- if (this._ignoreBackdropClick) {
294
- this._ignoreBackdropClick = false
295
- return
296
- }
297
-
298
- if (event.target !== event.currentTarget) {
299
- return
300
- }
301
-
302
- if (this._config.backdrop === true) {
303
- this.hide()
304
- } else if (this._config.backdrop === 'static') {
305
- this._triggerBackdropTransition()
306
- }
307
- })
308
-
309
- this._backdrop.show(callback)
310
- }
311
-
312
255
  _isAnimated() {
313
256
  return this._element.classList.contains(CLASS_NAME_FADE)
314
257
  }
@@ -319,46 +262,45 @@ class Modal extends BaseComponent {
319
262
  return
320
263
  }
321
264
 
322
- const { classList, scrollHeight, style } = this._element
323
- const isModalOverflowing = scrollHeight > document.documentElement.clientHeight
324
-
265
+ const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight
266
+ const initialOverflowY = this._element.style.overflowY
325
267
  // return if the following background transition hasn't yet completed
326
- if ((!isModalOverflowing && style.overflowY === 'hidden') || classList.contains(CLASS_NAME_STATIC)) {
268
+ if (initialOverflowY === 'hidden' || this._element.classList.contains(CLASS_NAME_STATIC)) {
327
269
  return
328
270
  }
329
271
 
330
272
  if (!isModalOverflowing) {
331
- style.overflowY = 'hidden'
273
+ this._element.style.overflowY = 'hidden'
332
274
  }
333
275
 
334
- classList.add(CLASS_NAME_STATIC)
276
+ this._element.classList.add(CLASS_NAME_STATIC)
335
277
  this._queueCallback(() => {
336
- classList.remove(CLASS_NAME_STATIC)
337
- if (!isModalOverflowing) {
338
- this._queueCallback(() => {
339
- style.overflowY = ''
340
- }, this._dialog)
341
- }
278
+ this._element.classList.remove(CLASS_NAME_STATIC)
279
+ this._queueCallback(() => {
280
+ this._element.style.overflowY = initialOverflowY
281
+ }, this._dialog)
342
282
  }, this._dialog)
343
283
 
344
284
  this._element.focus()
345
285
  }
346
286
 
347
- // ----------------------------------------------------------------------
348
- // the following methods are used to handle overflowing modals
349
- // ----------------------------------------------------------------------
287
+ /**
288
+ * The following methods are used to handle overflowing modals
289
+ */
350
290
 
351
291
  _adjustDialog() {
352
292
  const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight
353
293
  const scrollbarWidth = this._scrollBar.getWidth()
354
294
  const isBodyOverflowing = scrollbarWidth > 0
355
295
 
356
- if ((!isBodyOverflowing && isModalOverflowing && !isRTL()) || (isBodyOverflowing && !isModalOverflowing && isRTL())) {
357
- this._element.style.paddingLeft = `${scrollbarWidth}px`
296
+ if (isBodyOverflowing && !isModalOverflowing) {
297
+ const property = isRTL() ? 'paddingLeft' : 'paddingRight'
298
+ this._element.style[property] = `${scrollbarWidth}px`
358
299
  }
359
300
 
360
- if ((isBodyOverflowing && !isModalOverflowing && !isRTL()) || (!isBodyOverflowing && isModalOverflowing && isRTL())) {
361
- this._element.style.paddingRight = `${scrollbarWidth}px`
301
+ if (!isBodyOverflowing && isModalOverflowing) {
302
+ const property = isRTL() ? 'paddingRight' : 'paddingLeft'
303
+ this._element.style[property] = `${scrollbarWidth}px`
362
304
  }
363
305
  }
364
306
 
@@ -368,7 +310,6 @@ class Modal extends BaseComponent {
368
310
  }
369
311
 
370
312
  // Static
371
-
372
313
  static jQueryInterface(config, relatedTarget) {
373
314
  return this.each(function () {
374
315
  const data = Modal.getOrCreateInstance(this, config)
@@ -387,9 +328,7 @@ class Modal extends BaseComponent {
387
328
  }
388
329
 
389
330
  /**
390
- * ------------------------------------------------------------------------
391
- * Data Api implementation
392
- * ------------------------------------------------------------------------
331
+ * Data API implementation
393
332
  */
394
333
 
395
334
  EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
@@ -412,10 +351,10 @@ EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (
412
351
  })
413
352
  })
414
353
 
415
- // avoid conflict when clicking moddal toggler while another one is open
416
- const allReadyOpen = SelectorEngine.findOne(OPEN_SELECTOR)
417
- if (allReadyOpen) {
418
- Modal.getInstance(allReadyOpen).hide()
354
+ // avoid conflict when clicking modal toggler while another one is open
355
+ const alreadyOpen = SelectorEngine.findOne(OPEN_SELECTOR)
356
+ if (alreadyOpen) {
357
+ Modal.getInstance(alreadyOpen).hide()
419
358
  }
420
359
 
421
360
  const data = Modal.getOrCreateInstance(target)
@@ -426,10 +365,7 @@ EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (
426
365
  enableDismissTrigger(Modal)
427
366
 
428
367
  /**
429
- * ------------------------------------------------------------------------
430
368
  * jQuery
431
- * ------------------------------------------------------------------------
432
- * add .Modal to jQuery only if jQuery is present
433
369
  */
434
370
 
435
371
  defineJQueryPlugin(Modal)