UNPKG

devextreme

Version:

HTML5 JavaScript Component Suite for Responsive Web Development

29 lines (27 loc) 964 B
/** * DevExtreme (esm/__internal/ui/toast/m_hide_toasts.js) * Version: 24.2.6 * Build date: Mon Mar 17 2025 * * Copyright (c) 2012 - 2025 Developer Express Inc. ALL RIGHTS RESERVED * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/ */ import $ from "../../../core/renderer"; const TOAST_CLASS = "dx-toast"; function hideAllToasts(container) { const toasts = $(".dx-toast").toArray(); if (!arguments.length) { toasts.forEach((toast => { $(toast).dxToast("hide") })); return } const containerElement = $(container).get(0); toasts.map((toast => $(toast).dxToast("instance"))).filter((instance => { const toastContainerElement = $(instance.option("container")).get(0); return containerElement === toastContainerElement && containerElement })).forEach((instance => { instance.hide() })) } export default hideAllToasts;