mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-07 08:34:29 +01:00
More changes related to getting tree to handle actions on its leaves
- Fix action system selection vs tree
This commit is contained in:
parent
f772bf69cd
commit
1c06e6864d
@ -18,8 +18,8 @@ import {FindActionTarget} from "../etemplate/FindActionTarget";
|
|||||||
export const EXPAND_FOLDER_ON_DRAG_DROP_TIMEOUT = 1000
|
export const EXPAND_FOLDER_ON_DRAG_DROP_TIMEOUT = 1000
|
||||||
|
|
||||||
export class EgwDragDropShoelaceTree extends egwActionObjectInterface{
|
export class EgwDragDropShoelaceTree extends egwActionObjectInterface{
|
||||||
node: SlTreeItem;
|
|
||||||
id: string;
|
id: string;
|
||||||
tree: Et2Tree;
|
tree: Et2Tree;
|
||||||
|
|
||||||
// Reference to the widget that's handling actions for us
|
// Reference to the widget that's handling actions for us
|
||||||
|
@ -1277,12 +1277,25 @@ export class Et2Tree extends Et2WidgetWithSelectMixin(LitElement) implements Fin
|
|||||||
if(!action)
|
if(!action)
|
||||||
{
|
{
|
||||||
// NOTE: FLAT object structure under the tree ActionObject to avoid nested selection
|
// NOTE: FLAT object structure under the tree ActionObject to avoid nested selection
|
||||||
action = this.widget_object.addObject(target.id, this.widget_object.iface);
|
action = this.widget_object.addObject(target.id, this.widget_object.iface)
|
||||||
|
action.setSelected = (set) =>
|
||||||
|
{
|
||||||
|
target.selected = set;
|
||||||
|
this.widget_object.updateSelectedChildren(action, set);
|
||||||
|
}
|
||||||
|
action.getSelected = () => target.selected;
|
||||||
// Required to get dropped accepted, but also re-binds
|
// Required to get dropped accepted, but also re-binds
|
||||||
action.updateActionLinks(this._get_action_links(this.actions));
|
action.updateActionLinks(this._get_action_links(this.actions));
|
||||||
}
|
}
|
||||||
// This is just the action system, which we override
|
// This is just the action system, which we override
|
||||||
this.widget_object.setAllSelected(false);
|
this.widget_object.setAllSelected(false);
|
||||||
|
// This will affect action system & DOM, but not our internal value
|
||||||
|
this.widget_object.children.forEach(c =>
|
||||||
|
{
|
||||||
|
c.setSelected(false)
|
||||||
|
})
|
||||||
|
|
||||||
|
this.widget_object.iface.stateChangeContext = action;
|
||||||
action.setSelected(true);
|
action.setSelected(true);
|
||||||
|
|
||||||
return {target: target, action: action};
|
return {target: target, action: action};
|
||||||
|
Loading…
Reference in New Issue
Block a user