mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-07 08:34:42 +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
f7e4a61cdd
commit
3ebf911427
@ -18,8 +18,8 @@ import {FindActionTarget} from "../etemplate/FindActionTarget";
|
||||
export const EXPAND_FOLDER_ON_DRAG_DROP_TIMEOUT = 1000
|
||||
|
||||
export class EgwDragDropShoelaceTree extends egwActionObjectInterface{
|
||||
node: SlTreeItem;
|
||||
id: string;
|
||||
|
||||
id: string;
|
||||
tree: Et2Tree;
|
||||
|
||||
// Reference to the widget that's handling actions for us
|
||||
|
@ -1304,12 +1304,25 @@ export class Et2Tree extends Et2WidgetWithSelectMixin(LitElement) implements Fin
|
||||
if(!action)
|
||||
{
|
||||
// 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
|
||||
action.updateActionLinks(this._get_action_links(this.actions));
|
||||
}
|
||||
// This is just the action system, which we override
|
||||
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);
|
||||
|
||||
return {target: target, action: action};
|
||||
|
Loading…
Reference in New Issue
Block a user