@mikezimm/npmfunctions
Version:
Functions used in my SPFx webparts
37 lines • 1.57 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.minimizeQuickLaunch = void 0;
/**
* This minimizes the quick launch, originally copied from ImageMapper
* @param document : should be of type Document
* @param minimize
*/
function minimizeQuickLaunch(document, minimize, alertError, consoleResult) {
if (alertError === void 0) { alertError = true; }
if (consoleResult === void 0) { consoleResult = false; }
try {
if (document.getElementById('spLeftNav')) {
if (minimize === false) {
document.getElementById('spLeftNav').style.width = null;
document.getElementById('spLeftNav').style.marginRight = null;
document.getElementById('spLeftNav').style.overflow = null;
}
else {
document.getElementById('spLeftNav').style.width = '20px';
document.getElementById('spLeftNav').style.marginRight = '50px';
document.getElementById('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');
}
}
exports.minimizeQuickLaunch = minimizeQuickLaunch;
//# sourceMappingURL=quickLaunch.js.map