Merge branch 'feature/section-context-menu-context-proxy' into feature/trashed-context

This commit is contained in:
Mads Rasmussen
2024-04-30 13:45:24 +02:00
2 changed files with 4 additions and 4 deletions

View File

@@ -17,19 +17,19 @@ export class UmbSectionSidebarContext extends UmbContextBase<UmbSectionSidebarCo
#headline = new UmbStringState<undefined>(undefined);
headline = this.#headline.asObservable();
#contextElement: HTMLElement | undefined = undefined;
#contextElement: Element | undefined = undefined;
constructor(host: UmbControllerHost) {
super(host, UMB_SECTION_SIDEBAR_CONTEXT);
}
toggleContextMenu(host: HTMLElement, args: UmbOpenContextMenuArgs) {
toggleContextMenu(host: Element, args: UmbOpenContextMenuArgs) {
this.openContextMenu(host, args);
}
// TODO: we wont get notified about tree item name changes because we don't have a subscription
// we need to figure out how we best can handle this when we only know the entity and unique id
openContextMenu(host: HTMLElement, args: UmbOpenContextMenuArgs) {
openContextMenu(host: Element, args: UmbOpenContextMenuArgs) {
this.#entityType.setValue(args.entityType);
this.#unique.setValue(args.unique);
this.#headline.setValue(args.headline);

View File

@@ -180,7 +180,7 @@ export abstract class UmbTreeItemContextBase<TreeItemType extends UmbTreeItemMod
throw new Error('Could not request children, tree item is not set');
}
this.#sectionSidebarContext?.toggleContextMenu(this, {
this.#sectionSidebarContext?.toggleContextMenu(this.getHostElement(), {
entityType: this.entityType,
unique: this.unique,
headline: this.getTreeItem()?.name || '',