infinity-forge
Version:
31 lines • 1.6 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.openSidebar = openSidebar;
exports.closeSidebar = closeSidebar;
function openSidebar() {
var _a, _b;
if (process.browser) {
var sidebarElement = document === null || document === void 0 ? void 0 : document.getElementById('sidebar');
var sidebarOverlay = document === null || document === void 0 ? void 0 : document.getElementById('sidebar-overlay');
if (sidebarElement && sidebarOverlay) {
(_a = sidebarElement === null || sidebarElement === void 0 ? void 0 : sidebarElement.classList) === null || _a === void 0 ? void 0 : _a.add('open');
(_b = sidebarOverlay === null || sidebarOverlay === void 0 ? void 0 : sidebarOverlay.classList) === null || _b === void 0 ? void 0 : _b.add('open');
return;
}
}
return;
}
function closeSidebar() {
var _a, _b;
if (process.browser) {
var sidebarElement = document.getElementById('sidebar');
var sidebarOverlay = document === null || document === void 0 ? void 0 : document.getElementById('sidebar-overlay');
if (sidebarElement && sidebarOverlay) {
(_a = sidebarElement === null || sidebarElement === void 0 ? void 0 : sidebarElement.classList) === null || _a === void 0 ? void 0 : _a.remove('open');
(_b = sidebarOverlay === null || sidebarOverlay === void 0 ? void 0 : sidebarOverlay.classList) === null || _b === void 0 ? void 0 : _b.remove('open');
return;
}
}
return;
}
//# sourceMappingURL=index.js.map