toggle dynamic structure

This commit is contained in:
Jan Prochazka
2021-12-02 14:52:25 +01:00
parent 8a13d88c3e
commit 5180e7ad27
2 changed files with 46 additions and 3 deletions

View File

@@ -1,5 +1,6 @@
import _ from 'lodash';
import { getContext, setContext } from 'svelte';
import invalidateCommands from '../commands/invalidateCommands';
import { currentDropDownMenu } from '../stores';
import getAsArray from './getAsArray';
@@ -9,9 +10,12 @@ export function registerMenu(...items) {
}
export default function contextMenu(node, items = []) {
const handleContextMenu = e => {
const handleContextMenu = async e => {
e.preventDefault();
e.stopPropagation();
await invalidateCommands();
if (items) {
const left = e.pageX;
const top = e.pageY;