An already active overlay such as the mobile menu could cause the page to become scrollable.
See https://www.woltlab.com/community/thread/295731-mobil-%C3%B6ffnen-der-suche-nach-%C3%B6ffnen-eines-men%C3%BCs-fehlerhaft/
export enum Origin {
Document = "document",
DropDown = "dropdown",
+ Search = "search",
}
type Callback = (origin?: string | Origin, identifier?: string) => void;
});
UiCloseOverlay.add("WoltLabSuite/Core/Ui/Search", (origin, identifier) => {
- if (origin === Origin.DropDown) {
+ if (origin === Origin.Search) {
+ return;
+ } else if (origin === Origin.DropDown) {
const button = document.getElementById("pageHeaderSearchTypeSelect")!;
if (button.dataset.target === identifier) {
return;
}
function openSearch(): void {
- UiCloseOverlay.execute();
+ UiCloseOverlay.execute(Origin.Search);
_pageHeader.classList.add("searchBarOpen");
_userPanelSearchButton?.parentElement!.classList.add("open");
(function (Origin) {
Origin["Document"] = "document";
Origin["DropDown"] = "dropdown";
+ Origin["Search"] = "search";
})(Origin = exports.Origin || (exports.Origin = {}));
let hasGlobalListener = false;
function add(identifier, callback) {
}
});
CloseOverlay_1.default.add("WoltLabSuite/Core/Ui/Search", (origin, identifier) => {
- if (origin === CloseOverlay_1.Origin.DropDown) {
+ if (origin === CloseOverlay_1.Origin.Search) {
+ return;
+ }
+ else if (origin === CloseOverlay_1.Origin.DropDown) {
const button = document.getElementById("pageHeaderSearchTypeSelect");
if (button.dataset.target === identifier) {
return;
});
}
function openSearch() {
- CloseOverlay_1.default.execute();
+ CloseOverlay_1.default.execute(CloseOverlay_1.Origin.Search);
_pageHeader.classList.add("searchBarOpen");
_userPanelSearchButton === null || _userPanelSearchButton === void 0 ? void 0 : _userPanelSearchButton.parentElement.classList.add("open");
if (!_isMobile) {