Cleanup Dropdowns handling

This commit is contained in:
the-djmaze 2022-03-08 10:52:08 +01:00
parent ffcd9990eb
commit 04f4538700
5 changed files with 14 additions and 14 deletions

View file

@ -18,6 +18,7 @@ export const
SettingsGet = Settings.get,
SettingsCapa = Settings.capa,
dropdowns = [],
dropdownVisibility = ko.observable(false).extend({ rateLimit: 0 }),
moveAction = ko.observable(false),

View file

@ -1,7 +1,7 @@
import { MessageFlagsCache, addRequestedMessage } from 'Common/Cache';
import { Notification } from 'Common/Enums';
import { MessageSetAction, ComposeType/*, FolderType*/ } from 'Common/EnumsUser';
import { doc, createElement, elementById } from 'Common/Globals';
import { doc, createElement, elementById, dropdowns, dropdownVisibility } from 'Common/Globals';
import { plainToHtml } from 'Common/Html';
import { getNotification } from 'Common/Translator';
import { EmailModel } from 'Model/Email';
@ -15,6 +15,10 @@ import Remote from 'Remote/User/Fetch';
export const
dropdownsDetectVisibility = (() =>
dropdownVisibility(!!dropdowns.find(item => item.classList.contains('show')))
).debounce(50),
/**
* @param {string} link
* @returns {boolean}