sweetalert2 11.1.7 → 11.2.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.
@@ -5,9 +5,6 @@ import { capitalizeFirstLetter } from '../../utils.js'
5
5
  export const renderActions = (instance, params) => {
6
6
  const actions = dom.getActions()
7
7
  const loader = dom.getLoader()
8
- const confirmButton = dom.getConfirmButton()
9
- const denyButton = dom.getDenyButton()
10
- const cancelButton = dom.getCancelButton()
11
8
 
12
9
  // Actions (buttons) wrapper
13
10
  if (!params.showConfirmButton && !params.showDenyButton && !params.showCancelButton) {
@@ -19,6 +16,19 @@ export const renderActions = (instance, params) => {
19
16
  // Custom class
20
17
  dom.applyCustomClass(actions, params, 'actions')
21
18
 
19
+ // Render all the buttons
20
+ renderButtons(actions, loader, params)
21
+
22
+ // Loader
23
+ dom.setInnerHtml(loader, params.loaderHtml)
24
+ dom.applyCustomClass(loader, params, 'loader')
25
+ }
26
+
27
+ function renderButtons (actions, loader, params) {
28
+ const confirmButton = dom.getConfirmButton()
29
+ const denyButton = dom.getDenyButton()
30
+ const cancelButton = dom.getCancelButton()
31
+
22
32
  // Render buttons
23
33
  renderButton(confirmButton, 'confirm', params)
24
34
  renderButton(denyButton, 'deny', params)
@@ -26,14 +36,15 @@ export const renderActions = (instance, params) => {
26
36
  handleButtonsStyling(confirmButton, denyButton, cancelButton, params)
27
37
 
28
38
  if (params.reverseButtons) {
29
- actions.insertBefore(cancelButton, loader)
30
- actions.insertBefore(denyButton, loader)
31
- actions.insertBefore(confirmButton, loader)
39
+ if (params.toast) {
40
+ actions.insertBefore(cancelButton, confirmButton)
41
+ actions.insertBefore(denyButton, confirmButton)
42
+ } else {
43
+ actions.insertBefore(cancelButton, loader)
44
+ actions.insertBefore(denyButton, loader)
45
+ actions.insertBefore(confirmButton, loader)
46
+ }
32
47
  }
33
-
34
- // Loader
35
- dom.setInnerHtml(loader, params.loaderHtml)
36
- dom.applyCustomClass(loader, params, 'loader')
37
48
  }
38
49
 
39
50
  function handleButtonsStyling (confirmButton, denyButton, cancelButton, params) {