mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-03 04:29:28 +01:00
cleanup EgwDragDropShoelaceTree.ts
-- use class ... extends ... instead of constructor returning different object
This commit is contained in:
parent
2e3be2b1b7
commit
d5ffc615af
@ -18,31 +18,28 @@ import {
|
|||||||
EGW_AO_STATE_SELECTED
|
EGW_AO_STATE_SELECTED
|
||||||
} from "./egw_action_constants";
|
} from "./egw_action_constants";
|
||||||
import {egwBitIsSet} from "./egw_action_common";
|
import {egwBitIsSet} from "./egw_action_common";
|
||||||
|
import {SlTreeItem} from "@shoelace-style/shoelace";
|
||||||
|
|
||||||
|
|
||||||
function dhtmlxTree_getNode(_tree: Et2Tree, _itemId: string)
|
|
||||||
{
|
|
||||||
const node = _tree.getDomNode(_itemId);
|
|
||||||
if (node != null)
|
|
||||||
{
|
|
||||||
return node
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export const EXPAND_FOLDER_ON_DRAG_DROP_TIMEOUT = 1000
|
export const EXPAND_FOLDER_ON_DRAG_DROP_TIMEOUT = 1000
|
||||||
|
|
||||||
export class EgwDragDropShoelaceTree {
|
export class EgwDragDropShoelaceTree extends egwActionObjectInterface{
|
||||||
constructor(_tree:Et2Tree, _itemId) {
|
node: SlTreeItem;
|
||||||
|
id: string;
|
||||||
|
tree: Et2Tree;
|
||||||
|
constructor(_tree:Et2Tree, _itemId: string) {
|
||||||
|
|
||||||
const aoi = new egwActionObjectInterface();
|
super();
|
||||||
aoi.node = _tree.getDomNode(_itemId);
|
this.node = _tree.getDomNode(_itemId);
|
||||||
aoi.id = _itemId
|
this.id = _itemId
|
||||||
aoi.doGetDOMNode = function () {
|
this.tree = _tree
|
||||||
return aoi.node;
|
this.doGetDOMNode = function () {
|
||||||
|
return this.node;
|
||||||
}
|
}
|
||||||
let timeout: NodeJS.Timeout;
|
let timeout: NodeJS.Timeout;
|
||||||
|
|
||||||
aoi.doTriggerEvent = function (_event) {
|
this.doTriggerEvent = function (_event) {
|
||||||
if (_event == EGW_AI_DRAG_ENTER)
|
if (_event == EGW_AI_DRAG_ENTER)
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -62,7 +59,7 @@ export class EgwDragDropShoelaceTree {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
aoi.doSetState = function (_state) {
|
this.doSetState = function (_state) {
|
||||||
if (!_tree || !_tree.focusItem) return;
|
if (!_tree || !_tree.focusItem) return;
|
||||||
|
|
||||||
// Update the "focused" flag
|
// Update the "focused" flag
|
||||||
@ -75,7 +72,5 @@ export class EgwDragDropShoelaceTree {
|
|||||||
// _tree.selectItem(this.id, false); // false = do not trigger onSelect
|
// _tree.selectItem(this.id, false); // false = do not trigger onSelect
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return aoi;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user