UNPKG

tdesign-mobile-vue

Version:
41 lines (38 loc) 1.33 kB
/** * tdesign v1.7.0 * (c) 2024 TDesign Group * @license MIT */ var DropdownMenuExpandState = /* @__PURE__ */function (DropdownMenuExpandState2) { DropdownMenuExpandState2["expanded"] = "expanded"; DropdownMenuExpandState2["collapsed"] = "collapsed"; return DropdownMenuExpandState2; }(DropdownMenuExpandState || {}); var oldOverflow = null; var context = { expandedMenuControl: null, recordMenuExpanded: function recordMenuExpanded(container, menuControl, action) { var containerDom = container; if (action === "expanded" /* expanded */) { var expandedMenuControl = this.expandedMenuControl; if (expandedMenuControl && expandedMenuControl !== menuControl) { expandedMenuControl.collapseMenu(); } this.expandedMenuControl = menuControl; if (oldOverflow === null) { oldOverflow = container.style.overflow; containerDom.style.overflow = "hidden"; } } else if (action === "collapsed" /* collapsed */) { if (this.expandedMenuControl === menuControl) { this.expandedMenuControl = null; } if (!this.expandedMenuControl && oldOverflow !== null) { containerDom.style.overflow = oldOverflow; oldOverflow = null; } } } }; export { DropdownMenuExpandState, context }; //# sourceMappingURL=context.js.map