Acme.BookStore.HttpApi.Host/node_modules/sweetalert2/src/instanceMethods/hideLoading.js
(完整代码) 1KBimport * as dom from '../utils/dom/index.js'
import { swalClasses } from '../utils/classes.js'
import privateProps from '../privateProps.js'
/**
* Hides loader and shows back the button which was hidden by .showLoading()
*/
function hideLoading () {
// do nothing if popup is closed
const innerParams = privateProps.innerParams.get(this)
if (!innerParams) {
return
}
const domCache = privateProps.domCache.get(this)
dom.hide(domCache.loader)
if (dom.isToast()) {
if (innerParams.icon) {
dom.show(dom.getIcon())
}
} else {
showRelatedButton(domCache)
}
dom.removeClass([domCache.popup, domCache.actions], swalClasses.loading)
domCache.popup.removeAttribute('aria-busy')
domCache.popup.removeAttribute('data-loading')
domCache.confirmButton.disabled = false
domCache.denyButton.disabled = false
domCache.cancelButton.disabled = false
}
const showRelatedButton = (domCache) => {
const buttonToReplace = domCache.popup.getElementsByClassName(domCache.loader.getAttribute('data-button-to-replace'))
if (buttonToReplace.length) {
dom.show(buttonToReplace[0], 'inline-block')
} else if (dom.allButtonsAreHidden()) {
dom.hide(domCache.actions)
}
}
export {
hideLoading,
hideLoading as disableLoading
}
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
