diff --git a/packages/frontend/src/os.ts b/packages/frontend/src/os.ts index 41b4dc3c0f..716d7a0b56 100644 --- a/packages/frontend/src/os.ts +++ b/packages/frontend/src/os.ts @@ -153,12 +153,23 @@ export const popups = ref<{ events: Record; }[]>([]); +/** + * An object containing z-index values for different priority levels. + */ const zIndexes = { veryLow: 500000, low: 1000000, middle: 2000000, high: 3000000, }; + +/** + * Claims a z-index value for a given priority level. + * Increments the z-index value for the specified priority by 100 and returns the new value. + * + * @param {keyof typeof zIndexes} [priority='low'] - The priority level for which to claim a z-index. + * @returns {number} The new z-index value for the specified priority. + */ export function claimZIndex(priority: keyof typeof zIndexes = 'low'): number { zIndexes[priority] += 100; return zIndexes[priority];