Skip to content

Support context menu in ImageSelection Plugin#1831

Merged
juliaroldi merged 6 commits into
masterfrom
u/juliaroldi/image-selection-context-menu
May 25, 2023
Merged

Support context menu in ImageSelection Plugin#1831
juliaroldi merged 6 commits into
masterfrom
u/juliaroldi/image-selection-context-menu

Conversation

@juliaroldi

@juliaroldi juliaroldi commented May 25, 2023

Copy link
Copy Markdown
Contributor

Instead of select the image when right click, use Context Menu event to select the image when right click a image.
Add copy/cut options to the image context menu to test image selection.

Before:
contextMenuSelectionBlue

After:
contextMenuSelection

if (
safeInstanceOf(contextMenuTarget, 'HTMLImageElement') &&
(actualSelection.type !== SelectionRangeTypes.ImageSelection ||
(actualSelection.type === SelectionRangeTypes.ImageSelection &&

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can remove the check to actualSelection.type === SelectionRangeTypes.ImageSelection because when it goes here, this must be true

@juliaroldi
juliaroldi merged commit a69181b into master May 25, 2023
@juliaroldi
juliaroldi deleted the u/juliaroldi/image-selection-context-menu branch May 25, 2023 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants