refactor interfaces and references

This commit is contained in:
geoffrey45
2022-11-30 20:27:44 +03:00
committed by Mungai Njoroge
parent 4a49d48011
commit 6d8a9f880b
44 changed files with 195 additions and 171 deletions
-30
View File
@@ -30,38 +30,9 @@ const context = useContextStore();
const settings = useSettingsStore();
const contextMenuRef = ref<HTMLElement>();
// let clickCount = 0;
// onClickOutside(
// contextMenuRef,
// (e) => {
// console.log(clickCount);
// if (!context.visible) {
// // clickCount = 0;
// return;
// }
// clickCount++;
// if (context.visible && clickCount === 1) {
// context.hideContextMenu();
// e.stopImmediatePropagation();
// clickCount = 0;
// }
// },
// {
// capture: false,
// }
// );
let watcher: any = null;
context.$subscribe((mutation, state) => {
// let watchers = [];
// console.log("watchers count: " + watchers.length)
// let wat: any = () => {};
if (state.visible) {
setTimeout(() => {
if (watcher !== null) {
@@ -71,7 +42,6 @@ context.$subscribe((mutation, state) => {
contextMenuRef,
(e) => {
e.stopImmediatePropagation();
console.log("clicked outside ref");
context.hideContextMenu();
},
{