mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-20 07:46:00 +00:00
#810 hide non active tool strip containers
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
import { getContext } from 'svelte';
|
||||
import { get_current_component, onMount, setContext } from 'svelte/internal';
|
||||
import invalidateCommands from '../commands/invalidateCommands';
|
||||
import { writable } from 'svelte/store';
|
||||
|
||||
const lastActiveDictionary = {};
|
||||
|
||||
export const isComponentActiveStore = writable((key: string, component) => false as boolean);
|
||||
|
||||
function isParent(parent, child) {
|
||||
while (child && child.activator) {
|
||||
if (parent == child) return true;
|
||||
@@ -54,7 +57,7 @@ export default function createActivator(
|
||||
}
|
||||
|
||||
// console.log('toDelete', toDelete);
|
||||
|
||||
|
||||
for (const del of toDelete) {
|
||||
delete lastActiveDictionary[del];
|
||||
}
|
||||
@@ -63,6 +66,10 @@ export default function createActivator(
|
||||
parentActivatorInstance.activator.activate();
|
||||
}
|
||||
// console.log('Active components', lastActiveDictionary);
|
||||
|
||||
isComponentActiveStore.set((key, component) => {
|
||||
return lastActiveDictionary[key] == component;
|
||||
});
|
||||
};
|
||||
|
||||
const getTabVisible = () => tabVisibleValue;
|
||||
|
||||
Reference in New Issue
Block a user