/** * Dailymotion Pro – Admin Video Embed: popup helpers * * Utility functions to show/hide the confirmation popup and a simple closer * used by inline onclick handlers in PHP markup. */ import { qs } from '../../Libs/Utils'; /** * Shows a popup by adding the 'showing' class. * Uses class-based visibility control for smooth CSS transitions. * @param id Element id of the popup overlay */ export function showPopup(id: string): void { const el = qs(id); if (el) { el.classList.add('showing'); } } /** * Hides a popup by removing the 'showing' class. * Uses class-based visibility control for smooth CSS transitions. * @param id Element id of the popup overlay */ export function hidePopup(id: string): void { const el = qs(id); if (el) { el.classList.remove('showing'); } } /** * Hides known overlays. Exposed globally as `closePopup` for compatibility * with existing inline event handlers. * Uses class-based visibility control for smooth CSS transitions. */ export function closePopupSimple(): void { const overlays: (HTMLElement | null)[] = [ qs('confirmDisableContextual'), qs('confirmSaveContextual'), ]; overlays.forEach((overlay) => { if (!overlay) return; overlay.classList.remove('showing'); }); }