1. *Grouping* becomes *view*. Because *view* is more clear and extensible than *grouping*. It increases flexibility to extend by e.g. adding *flat* as a new view as discussed in #50, in this case "flat *view*" would make more sense than "flat *grouping*". 2. *None* becomes *tree*. Because *tree* is more descriptive than *none*. Updates labels on top menu. As labels are updated, the file structure/names are refactored to follow the same concept. `TheScriptsList` is renamed to `TheScriptsView`. Also refactors `ViewChanger` so view types are presented in same way.
18 lines
436 B
TypeScript
18 lines
436 B
TypeScript
import { DirectiveOptions } from 'vue';
|
|
|
|
const attributeName = 'data-interaction-does-not-collapse';
|
|
|
|
export function hasDirective(el: Element): boolean {
|
|
if (el.hasAttribute(attributeName)) {
|
|
return true;
|
|
}
|
|
const parent = el.closest(`[${attributeName}]`);
|
|
return !!parent;
|
|
}
|
|
|
|
export const NonCollapsing: DirectiveOptions = {
|
|
inserted(el: HTMLElement) {
|
|
el.setAttribute(attributeName, '');
|
|
},
|
|
};
|