Skip to content

Refactor WorkspaceSvg.prototype.isDragging to call Mover.prototype.isMoving(this) #8960

Open
@cpcallen

Description

@cpcallen

PR #8959 added support for treating keyboard moves as if they were drags in WorkspaceSvg.prototype.isDragging. At present this is done by having a set method, .setKeyboardMoveInProgress, that is called from Mover.prototype.startMove, .finishMove and .abortMove, but there is some possibility that the state of .isKeyboardMoveInProgress could get out of sync with the Mover state.

It would be better to have .isDragging call mover.isMoving(this) directly, to check whether this workspace is one of the keys present in the Mover's .moves map. Unfortunately there is not at present any easy way for a WorkspaceSvg to get access to the (should-but-not-currently-guaranteed-to-be singleton) Mover instance.

It seems likely that Mover will eventually become part of core (and possibly be refactored to be per-Workspace rather than a singleton), at which point this is likely to be much easier.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions