Reenable touch events.

This commit is contained in:
Paulo Gustavo Veiga 2022-11-20 08:28:53 -08:00
parent 2eb72625d6
commit 4253479b75
2 changed files with 15 additions and 11 deletions

View File

@ -618,6 +618,8 @@ class Designer extends Events {
// Render nodes ... // Render nodes ...
nodesGraph.forEach((topic) => topic.setVisibility(true)); nodesGraph.forEach((topic) => topic.setVisibility(true));
// Enable workspace drag events ...
this._workspace.registerEvents();
// Finally, sort the map ... // Finally, sort the map ...
EventBus.instance.fireEvent('forceLayout'); EventBus.instance.fireEvent('forceLayout');
this.fireEvent('loadSuccess'); this.fireEvent('loadSuccess');

View File

@ -60,6 +60,16 @@ class Workspace {
// Append to the workspace... // Append to the workspace...
workspace.addItAsChildTo(divContainer); workspace.addItAsChildTo(divContainer);
this.setZoom(zoom, true);
this._renderQueue = [];
}
private _adjustWorkspace(): void {
this.setZoom(this._zoom, false);
}
registerEvents() {
// Register drag events ... // Register drag events ...
this._registerDragEvents(); this._registerDragEvents();
this._eventsEnabled = true; this._eventsEnabled = true;
@ -68,14 +78,6 @@ class Workspace {
window.addEventListener('resize', () => { window.addEventListener('resize', () => {
this._adjustWorkspace(); this._adjustWorkspace();
}); });
this.setZoom(zoom, true);
this._renderQueue = [];
}
private _adjustWorkspace(): void {
this.setZoom(this._zoom, false);
} }
isReadOnly(): boolean { isReadOnly(): boolean {
@ -282,7 +284,7 @@ class Workspace {
wasDragged = true; wasDragged = true;
}; };
screenManager.addEvent('mousemove', workspace._mouseMoveListener); screenManager.addEvent('mousemove', workspace._mouseMoveListener);
// screenManager.addEvent('touchmove', workspace._mouseMoveListener); screenManager.addEvent('touchmove', workspace._mouseMoveListener);
// Register mouse up listeners ... // Register mouse up listeners ...
workspace._mouseUpListener = () => { workspace._mouseUpListener = () => {
@ -304,14 +306,14 @@ class Workspace {
} }
}; };
screenManager.addEvent('mouseup', workspace._mouseUpListener); screenManager.addEvent('mouseup', workspace._mouseUpListener);
// screenManager.addEvent('touchend', workspace._mouseUpListener); screenManager.addEvent('touchend', workspace._mouseUpListener);
} }
} else { } else {
workspace._mouseUpListener(); workspace._mouseUpListener();
} }
}; };
screenManager.addEvent('mousedown', mouseDownListener); screenManager.addEvent('mousedown', mouseDownListener);
// screenManager.addEvent('touchstart', mouseDownListener); screenManager.addEvent('touchstart', mouseDownListener);
} }
getZoom() { getZoom() {