Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /var/www/html/queuepro/node_modules/sweetalert2/src/staticMethods/ drwxrwxr-x | |
| Viewing file: Select action/file-type: import * as dom from '../utils/dom/index.js'
import Swal from '../sweetalert2.js'
import { swalClasses } from '../utils/classes.js'
/**
* Shows loader (spinner), this is useful with AJAX requests.
* By default the loader be shown instead of the "Confirm" button.
*/
const showLoading = (buttonToReplace) => {
let popup = dom.getPopup()
if (!popup) {
new Swal() // eslint-disable-line no-new
}
popup = dom.getPopup()
const loader = dom.getLoader()
if (dom.isToast()) {
dom.hide(dom.getIcon())
} else {
replaceButton(popup, buttonToReplace)
}
dom.show(loader)
popup.setAttribute('data-loading', true)
popup.setAttribute('aria-busy', true)
popup.focus()
}
const replaceButton = (popup, buttonToReplace) => {
const actions = dom.getActions()
const loader = dom.getLoader()
if (!buttonToReplace && dom.isVisible(dom.getConfirmButton())) {
buttonToReplace = dom.getConfirmButton()
}
dom.show(actions)
if (buttonToReplace) {
dom.hide(buttonToReplace)
loader.setAttribute('data-button-to-replace', buttonToReplace.className)
}
loader.parentNode.insertBefore(loader, buttonToReplace)
dom.addClass([popup, actions], swalClasses.loading)
}
export { showLoading, showLoading as enableLoading }
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.026 ]-- |