UNPKG

@mikezimm/fps-library-v2

Version:

Library of reusable typescript/javascript functions, interfaces and constants

53 lines (52 loc) 2.06 kB
/** * CodeAnalizerComment: Updated 1 imports on 2024-09-21 23:07:24 * Update:: import { check4This } to '@mikezimm/fps-core-v7/lib/logic/Links/CheckSearch;' */ /** * Used with FPS Options Functions * @param quickLaunchHide */ import { check4This, Check4 } from "@mikezimm/fps-core-v7/lib/logic/Links/CheckSearch"; /** * This minimizes the quick launch, originally copied from ImageMapper * @param document : should be of type Document * @param minimize */ //2022-11-27: Removed document argument because it is visible from here /** * Combines setQuickLaunch and minimizeQuickLaunch into one */ export function setQuickLaunch(minimize, alertError = true, consoleResult = false) { if (check4This(Check4.skipStyleChanges_Eq_true) === true) { console.log(`${Check4.skipStyleChanges_Eq_true} @ setQuickLaunch`); return; } //specifically not undefined or null in case it is not yet preset. if (minimize === true || minimize === false) { try { const spLeftNav = document.getElementById('spLeftNav'); if (spLeftNav !== null) { if (minimize === false) { spLeftNav.style.width = 'null'; spLeftNav.style.marginRight = 'null'; spLeftNav.style.overflow = 'null'; } else { spLeftNav.style.width = '20px'; spLeftNav.style.marginRight = '50px'; spLeftNav.style.overflow = 'hidden'; } } if (consoleResult === true) { console.log('minimizeQuickLaunch: set minimize to ', minimize); } } catch (e) { if (alertError === true) { alert('minimizeQuickLaunch: Could not find element with id: spLeftNav'); } console.log('minimizeQuickLaunch: Could not find element with id: spLeftNav'); } } } //# sourceMappingURL=quickLaunch.js.map