fix the context menu disappears after the second long press on the add icon on the mobile home page

This commit is contained in:
MaysWind
2026-03-06 00:43:05 +08:00
parent cabe365907
commit b81d2ec63c
2 changed files with 8 additions and 3 deletions
+6 -2
View File
@@ -22,6 +22,8 @@ import { useExchangeRatesStore } from '@/stores/exchangeRates.ts';
import { APPLICATION_LOGO_PATH } from '@/consts/asset.ts'; import { APPLICATION_LOGO_PATH } from '@/consts/asset.ts';
import { ThemeType } from '@/core/theme.ts'; import { ThemeType } from '@/core/theme.ts';
import { isFunction } from '@/lib/common.ts';
import { isProduction } from '@/lib/version.ts'; import { isProduction } from '@/lib/version.ts';
import { getTheme, isEnableSwipeBack, isEnableAnimate } from '@/lib/settings.ts'; import { getTheme, isEnableSwipeBack, isEnableAnimate } from '@/lib/settings.ts';
import { initMapProvider } from '@/lib/map/index.ts'; import { initMapProvider } from '@/lib/map/index.ts';
@@ -161,7 +163,7 @@ onMounted(() => {
f7.on('sheetOpen', (sheet: Sheet.Sheet) => onBackdropChanged(sheet)); f7.on('sheetOpen', (sheet: Sheet.Sheet) => onBackdropChanged(sheet));
f7.on('sheetClose', (sheet: Sheet.Sheet) => onBackdropChanged(sheet)); f7.on('sheetClose', (sheet: Sheet.Sheet) => onBackdropChanged(sheet));
f7.on('pageBeforeOut', () => { f7.on('pageBeforeOut', () => {
if (isModalShowing()) { if (isModalShowing()) {
f7.actions.close('.actions-modal.modal-in', false); f7.actions.close('.actions-modal.modal-in', false);
f7.dialog.close('.dialog.modal-in', false); f7.dialog.close('.dialog.modal-in', false);
@@ -183,7 +185,9 @@ onMounted(() => {
}); });
document.addEventListener('dragstart', (e) => { document.addEventListener('dragstart', (e) => {
e.preventDefault(); if (!e.target || !('closest' in e.target) || !isFunction(e.target.closest) || !e.target.closest('.dragenabled')) {
e.preventDefault();
}
}, true); }, true);
}); });
+2 -1
View File
@@ -172,7 +172,8 @@
<f7-icon f7="creditcard"></f7-icon> <f7-icon f7="creditcard"></f7-icon>
<span class="tabbar-label">{{ tt('Accounts') }}</span> <span class="tabbar-label">{{ tt('Accounts') }}</span>
</f7-link> </f7-link>
<f7-link id="homepage-add-button" class="link" href="/transaction/add" @taphold="openTransactionTemplatePopover"> <f7-link id="homepage-add-button" class="link dragenabled"
href="/transaction/add" @taphold="openTransactionTemplatePopover">
<f7-icon f7="plus_square" class="ebk-tarbar-big-icon"></f7-icon> <f7-icon f7="plus_square" class="ebk-tarbar-big-icon"></f7-icon>
</f7-link> </f7-link>
<f7-link class="link" href="/statistic/transaction"> <f7-link class="link" href="/statistic/transaction">